Resetting a Web Page’s Background

Script 17.2 is simple but powerful. Have you ever visited a site that you knew had lots of useful information, but the background color was so close to the text color that the information was unreadable? Or worse, the page’s author used violently clashing colors that made your eyes water? This little bookmarklet solves those problems. Note that at this point, using the bookmarklet changes the way that you’re viewing someone else’s page—that’s part of the power of bookmarklets. Of course, it doesn’t change the actual page, just the way that your browser displays it.

To reset the background of a page:

  • javascript:void(document.body.style.background='#FFF');

    This script uses the document. body. style.background object ...

Get JavaScript and Ajax for the Web: Visual QuickStart Guide, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.