user765368
user765368

Reputation: 20346

cancel or reset inherited css styles

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

Answers (2)

You knows who
You knows who

Reputation: 895

You just need to remove the .my_button class , like this:

$('#ID_of_thebutton').removeClass('my_button')

Upvotes: 0

Niet the Dark Absol
Niet the Dark Absol

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

Related Questions