Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var myFunction = function(a){ // Supply a valid selector (e.g '*' for wildcard)
- [].forEach.call( // Treat Nodelist as an Array (fewer bytes than Array.prototype.forEach.call(...);)
- // Gets the prototype of Array & uses call to execute the function on the NodeList.
- document.querySelectorAll(a), // Query DOM for elements matching the supplied selector
- // (For 110 bytes, use $$() as Chrome, Safari & FF expose it in DevTools)
- function(b){
- b.style.outline = "1px solid #" + // Set the selector outline
- (~~(Math.random()*(1<<24))) // Pick a valid random CSS hex color
- .toString(16)}) // Convert to a base 16 number. BOOM.
- }
- myFunction('*');
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement