I've got some code that works fine - I adapted it from something else (this is the simplified version, not production, of course):
$(".colorMe td").each(function() {
var val = (this.innerHTML);
if (val == "Yes") {
this.style.backgroundColor = "#F00000";
}
});
See also http://jsfiddle.net/GAwrB/221/
I don't know what the $ means though. I've seen lost of other posts saying that it might have something to do with jQuery, but I can't find any definitive answer. I'm sure that other newbies like me would find it useful to know.
Edit:
This question is different from Why does JQuery have dollar signs everywhere? as I initially didn't know that the $ meant jQuery - so the previous question isn't useful for anyone like me, who'd new to javascript.
I also see that there are basically two different answers given - some say that $ is a variable name, while others say that it calls jQuery - look to me that the jQuery answer is right here - in which case, I don't understand why some people say that it's a variable name - I assume that that's right in some cases.