Question: I have a DIV element as a pop-up window that has the following style:

```
#navbox { width: 220px; }

```

Now when the window appears, the user has the ability to toggle the width of the window. The window length when toggled is 520px. When the user clicks on a button to clear the data, I want the window to resize back to it's original width.

I could do it in code:

```
$('#navbox').width('220px');

```

But I'm wondering if there's a way to "re-apply" the original #nav box definition using jQuery?

This question deals with classes. But what about DIV's?

[re-apply css classes using jquery](https://stackoverflow.com/questions/7726832/re-apply-css-classes-using-jquery)

I tried:

```
$('div#navbox').removeClass('#navbox').addClass('#navbox');

```

and this didn't work the way I hoped.

Answer: 
```
#navbox {
    width: 220px;
}

#navbox.toggled {
    width: 520px;
}

```

toggle the size of the window by adding a class to it.

```
$('#navbox').addClass("toggled")

```

remove the class to set the size back to the original one

```
$('#navbox').removeClass("toggled")

```

another possibility might be to set and and remove `min-height`
You are trying to add an id with add/remove class, which I am not sure if that will work. Even so, normally when you use that function you don't add the . or # symbols in front of the element since the function is expecting a class.