
Originally Posted by
shachi
Can anyone tell me if there is any function like resetStyles in javascript that zaps all javascript made style changes?
Not automatically, no. You would have to track the changes that you make, yourself.
Assigning an empty string to a property of an in-line style object will remove that declaration:
Code:
element.style.color = 'red'; /* #ff0000 */
element.style.color = ''; /* Colour now taken from cascade. */
That would also remove any such declarations applied by the style attribute in markup as they are equivalent.
HTML Code:
<span style="color: red;">...</span>
You're probably aware of this, but just in case you weren't...
Mike
Bookmarks