Whenever I produce I website I am always thankful for the Firefox Web Developer Toolbar extension; it’s an incredible convenience. One particular feature that I use constantly is “Outline”. This feature is great for seeing the locations of various elements on any page. But I’ve always wished that there was an equivalent feature/extension for Internet Explorer. Well, to my knowledge, there isn’t, but I’ve thrown together a little script (Javascript, to be exact) that outlines (virtually) any given element in colors of my choice. Here’s the script:
function outline(){
var tagArray=['p','a','div'];
var colors=['red','green','blue'];
for (var i=0; i<tagArray.length; i++){
var tags = document.getElementsByTagName(tagArray[i]);
for (var j=0; j<tags.length; j++){
var tag = tags[j];
tag.style.border = ['1px solid '+colors[i]];
}
}
}
Obviously the code is not that complex, but it can be incredibly useful. One particularly nice thing about it is that one could place a fairly large amount of elements into the arrays.
Here’s a bookmark that I use anytime I want to call this script into action: Bookmark me. Using it this way is far more convenient, in my opinion. Well, I hope someone finds this useful; enjoy.