Reputation: 20346
let's say I have a button which has the following css style applied to it:
.my_button
{
height: 30px;
}
Now let's say on some pages in my application, I don't want my button to have a height of 30px (Neither do I want to give it a new height), I want it to have its default height set by jquery ui. How can I cancel/reset that css that is applied to my button?
Thank you
Upvotes: 1
Views: 1436
Reputation: 895
You just need to remove the .my_button class , like this:
$('#ID_of_thebutton').removeClass('my_button')
Upvotes: 0
Reputation: 324640
To reset a CSS property, set it to the default value.
For height
, the default value is auto
.
To get the default for any style, open about:blank
and run the following in your JS console:
getComputedStyle(document.createElement('span')).PROPERTY
Where PROPERTY
is the one you want. height
, width
, background-color
, whatever you want to find the default for.
Upvotes: 2