Wednesday September 18, 2002

Here's a handy chunk of javascript for visualizing the DIVs in a web page:

javascript:void(d=document);void(el=d.getElementsByTagName('div')); for(i=0;i<el.length;i++){ void(el[i].style.border='1px dashed gray')}; void(el=d.getElementsByTagName('span')); for(i=0;i<el.length;i++){ void(el[i].style.border='1px solid black');}

Plop it into a bookmark (or drag this link to your toolbar). When you use this the current page changes to show borders around all DIVs. Found on another weblog but can't remember which to give proper credit. Works in Mozilla & IE.