Forum Moderators: not2easy
this maybe should be in the javascript forum, but here goes.
i have a table, cells have ids, and will be updated dynamically with JS. question is , can i in fact apply a className to these table cells, (which in fact are spans with ids not tds) via javascript on the fly?
css will allow a classname and an id, i presume, and then the classname would take precedence over the id style in the cascade?
as i am wanting to change to color of the text depending on this that and the other...
i hope that explanation makes some sense.
tia
nat
That leaves us with two options for how to change the styling:
document.getElementById('foo').className = 'bar';
OR
document.getElementById('foo').style.color = 'red';
Personally I would go with the latter...