Last Updated: February 25, 2016
·
582
· mweppler

Borderify DOM Elements

Add a 1 pixel, solid, red border to all dom elements with this bookmarklet:

javascript: (function (document, undefined) {
  var elements = document.getElementsByTagName('*');
  var _i = 0;
  for (; _i < elements.length; _i++) {
    elements[_i].style.border = '1px solid red';
    elements[_i].title = elements[_i].tagName + ' -  id: ' + elements[_i].id + ' - classList: ' + elements[_i].classList;
  }
})(window.document);

Minified Version:

javascript:(function(){javascript:(function(c,d){for(var b=c.getElementsByTagName("*"),a=0;a<b.length;a++)b[a].style.border="1px solid red",b[a].title=b[a].tagName+" -  id: "+b[a].id+" - classList: "+b[a].classList})(window.document);})();