Created
January 31, 2013 14:25
-
-
Save apaatsio/4683184 to your computer and use it in GitHub Desktop.
Highlight all DOM elements with a color so it's easy see an overview of the elements at quick glance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var elements = document.querySelectorAll('*'); | |
Array.prototype.slice.call(elements).forEach(function (element) { | |
var rgba = [Math.floor(Math.random()*256), Math.floor(Math.random()*256), Math.floor(Math.random()*256), 0.1]; | |
element.style.background = 'none'; | |
element.style.backgroundColor = 'rgba(' + rgba.join(',') + ')'; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment