var s = document.getElementsByTagName("*")
for(a in s) {
s[a].style.background = "#FFD"
if(s[a].nodeName == "A") { // HREFs
s[a].style.color = "#00F"
s[a].style.textDecoration = "none"
} else {
s[a].style.color = "#111"
}
}
And here's a bit of helper code to inspect collections :
(in Chickenfoot the last evaluation is printed on the console)
function inspect(e) {
var b = ""
for(k in e) {
b += k + " = " + e[k] + "\n"
}
return b
}
// use it like this :
var c = ""
var s = document.getElementsByTagName("*")
for(a in s)
c += inspect(s[a])
c
This simple script sat on right click has made my day, and it's only midday!
No comments:
Post a Comment