I'm trying to change the font color of negative numbers in a table to
red. After working all day, still no luck. To debug, I put a button
on the gadget and set it's onclick method to "TraverseDOM();" I was
expecting the output of str to be the value of each cell on a separate
line. But nothing happens when I click it. Any help?
function TraverseDOM() {
TDs = document.getElementsByTagName("td");
var str = "# of table cells: " + TDs.length + "\n";
for (var i=0; i<TDs.length; i++) {
var temp = TDs[i];
str += i+ temp.firstChild.nodeValue + "\n";
if (temp.firstChild.nodeValue.indexOf("-") >= 0)
temp.className = "negative";
}
alert(str);
};
--
You received this message because you are subscribed to the Google Groups
"iGoogle Developer Forum" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/Google-Gadgets-API?hl=en.