--- id: bad87fee1348bd9bedc08826 title: Target HTML Elements with Selectors Using jQuery required: - link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css' challengeType: 6 videoUrl: '' localeTitle: 使用选择器使用jQuery定位HTML元素 --- ## Description
现在我们有一个document ready function 。现在让我们编写第一个jQuery语句。所有jQuery函数都以$开头,通常称为dollar sign operator ,或者作为bling 。 jQuery经常选择带有selector的HTML元素,然后对该元素执行某些操作。例如,让我们使所有button元素反弹。只需在您的文档就绪函数中添加此代码: $("button").addClass("animated bounce");请注意,我们已经在后台包含了jQuery库和Animate.css库,以便您可以在编辑器中使用它们。所以你使用jQuery将Animate.css bounce类应用于你的button元素。
## Instructions
## Tests
```yml tests: - text: 使用jQuery addClass()函数将类animatedbounce回到button元素。 testString: 'assert($("button").hasClass("animated") && $("button").hasClass("bounce"));' - text: 只使用jQuery将这些颜色添加到元素中。 testString: 'assert(!code.match(/class.*animated/g));' - text: 你的jQuery代码应该在$(document).ready();功能。 testString: assert(code.match(/\$\(document\)\.ready\(function.*(\s|\n)*.*button.*.addClass.*\);/g)); ```
## Challenge Seed
```html

jQuery Playground

#left-well

#right-well

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