--- id: bad87fee1348bd9aed918626 title: Remove Classes from an Element with jQuery challengeType: 6 forumTopicId: 18264 required: - link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css' dashedName: remove-classes-from-an-element-with-jquery --- # --description-- In the same way you can add classes to an element with jQuery's `addClass()` function, you can remove them with jQuery's `removeClass()` function. Here's how you would do this for a specific button: ```js $("#target2").removeClass("btn-default"); ``` Let's remove the `btn-default` class from all of our `button` elements. # --hints-- The `btn-default` class should be removed from all of your `button` elements. ```js assert($('.btn-default').length === 0); ``` You should only use jQuery to remove this class from the element. ```js assert(code.match(/btn btn-default/g)); ``` You should only remove the `btn-default` class. ```js assert( code.match( /\.[\v\s]*removeClass[\s\v]*\([\s\v]*('|")\s*btn-default\s*('|")[\s\v]*\)/gm ) ); ``` # --seed-- ## --seed-contents-- ```html

jQuery Playground

#left-well

#right-well

``` # --solutions-- ```html

jQuery Playground

#left-well

#right-well

```