Restoring CSS Properties


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.



you can remove all of an element’s inline styles by setting‘’;

If you only want to remove the background-color use‘’.

The stylesheet properties will then apply to the element again.

Thanks mrhoo, I will try that.