function(a){ // Supply a valid selector (e.g '*' for all) [].forEach.call( // Convert Nodelist -> Array document.querySelectorAll(a), // Query for the selector (could be shortened to $() as Chrome & 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. }