--- id: bad87fee1348bd9aed918626 title: Remove Classes from an Element with jQuery required: - link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css' challengeType: 6 videoUrl: '' localeTitle: 使用jQuery从元素中删除类 --- ## Description
以同样的方式,你可以添加类与jQuery的元素addClass()函数,你可以用jQuery的删除它们removeClass()函数。以下是为特定按钮执行此操作的方法: $("#target2").removeClass("btn-default");让我们从所有button元素中删除btn-default类。
## Instructions
## Tests
```yml tests: - text: 从所有button元素中删除btn-default类。 testString: 'assert($(".btn-default").length === 0, "Remove the btn-default class from all of your button elements.");' - text: 仅使用jQuery从元素中删除此类。 testString: 'assert(code.match(/btn btn-default/g), "Only use jQuery to remove this class from the element.");' - text: 只删除btn-default类。 testString: 'assert(code.match(/\.[\v\s]*removeClass[\s\v]*\([\s\v]*("|")\s*btn-default\s*("|")[\s\v]*\)/gm), "Only remove the btn-default class.");' ```
## Challenge Seed
```html

jQuery Playground

#left-well

#right-well

```
## Solution
```js // solution required ```