Skip to content

Instantly share code, notes, and snippets.

@anantakrroy
Created September 14, 2019 12:06
Show Gist options
  • Save anantakrroy/9bb8d1ba0514b0799e4aa90bfe6103ae to your computer and use it in GitHub Desktop.
Save anantakrroy/9bb8d1ba0514b0799e4aa90bfe6103ae to your computer and use it in GitHub Desktop.
FirstBookmarklet
<!DOCTYPE html>
<html>
<head>
<title>Bookmarklets</title>
</head>
<body>
<h2>Bookmarklet Example</h2>
<p>This is a <a href="javascript:(function() {let script = document.createElement('script');script.src = 'http://localhost:8000/bookmarklet.js';document.body.appendChild(script);})();">bookmarklet</a></p>
</body>
</html>
(function() {
let paragraph = document.getElementsByTagName('p');
for(let i = 0; i < paragraph.length; i++) {
paragraph[i].style['backgroundColor'] = '#AC4BD3';
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment