Thursday, August 19, 2010

Stupid Bookmark Tricks

Bookmarklets to change styles...

These work in Firefox, at least:

Turn all paragraph tags to red
javascript:(function%20(){var cssNode = document.createElement('style');cssNode.type = 'text/css';cssNode.rel = 'stylesheet';cssNode.innerHTML = 'p{color:red;}';document.getElementsByTagName("head")[0].appendChild(cssNode);})();

Set all image tags to display:none
javascript:(function%20(){var cssNode = document.createElement('style');cssNode.type = 'text/css';cssNode.rel = 'stylesheet';cssNode.innerHTML = 'img{display:none;}';document.getElementsByTagName("head")[0].appendChild(cssNode);})();

When clicked, these each use javascript to dynamically create a new style tag inside the head tag and also create a style within it.

Labels:

0 Comments:

Post a Comment

<< Home