0

Possible Duplicate:
Get back default properties after applying a global CSS reset

I want to set all CSS properties for an object to whatever the default value for that property is.

var element = this.get(0); // from jQuery
var props = [];
for (var prop in element.style)
    props.push(prop);
return;

I need to override an existing stylesheet is why.

e.g.:

display:default !important;
color:default !important;
border-radius:default !important;
line-size:default !important;

or

display:!important;
color:!important;
border-radius:!important;
line-size:!important;

*not just those styles. all styles

Community
  • 1
  • 1
dolphone bubleine
  • 691
  • 1
  • 8
  • 18

1 Answers1

6

You can use the initial keyword to restore the default value of a CSS property.

The initial CSS keyword applies the initial value of a property to an element. It is allowed on every CSS property and causes the element for which it is specified to use the initial value of the property.

To restore every property to it's initial value, you'll have to manually add every property to the element's style attribute with a value of "initial".

user229044
  • 232,980
  • 40
  • 330
  • 338