Return to Snippet

Revision: 17610
at September 10, 2009 10:07 by DaveChild


Initial Code
var elements = document.getElementsByTagName("*"); for (i = 0; i < elements.length; i++) { if (elements[i].getAttribute('style')) { var oldstyle =  elements[i].getAttribute('style'); elements[i].setAttribute('style', oldstyle + "border: 1px solid #f00;"); } }

Initial URL
http://www.addedbytes.com

Initial Description
Puts a red border around anything with an inline style. Prefix with "javascript:" and paste into the address bar to run on a page directly, or run with a load event.

Initial Title
JavaScript Highlight Inline Styles

Initial Tags
css, javascript

Initial Language
JavaScript