Skip to content

6.2 Bookmarklets

Overview
Learn how to use bookmarklets in your web browser.

A bookmarklet is like a regular browser bookmark except it contains Javascript instead of a URL. When you click the link the browser runs the Javascript on your current tab. These instructions demonstrate how to create a simple “hello world” bookmarket.

  1. Open a new pen at codepen.io and paste the string below into the HTML section. Instead of a URL, the link’s href uses the word “javascript” followed by actual script to run an alert on the page. When you test this link the browser will execute the Javascript.
Hello, World!
  1. To install the bookmarket, drag the link from the web page to your bookmarks bar. The browser will save the text inside the href as the URL.

Find more information about bookmarklets, including instructions to save the chapter 6 “Explode!” script or an HTML/CSS validation tool as bookmarklets, here: criticalwebdesign.github.io#bookmarklets