t0neburst — 2010-04-14T11:38:15-04:00 — #1
how do I restore CSS properties for a selected element? I want to change the background-color of a particular item on click, then restore the original CSS bgcolor from the stylesheet when it's clicked a 2nd time.
The item in question has a CSS class applied to it from the stylesheet.
mrhoo — 2010-04-14T13:15:33-04:00 — #2
you can remove all of an element's inline styles by setting element.style.cssText='';
If you only want to remove the background-color use element.style.backgroundColor=''.
The stylesheet properties will then apply to the element again.
t0neburst — 2010-04-15T04:28:35-04:00 — #3
Thanks mrhoo, I will try that.