--- id: bad87fee1348bd9aed008826 title: Target Even Elements Using jQuery required: - link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css' challengeType: 6 forumTopicId: 18318 localeTitle: Целевые четные элементы с помощью jQuery --- ## Description
Вы также можете настроить таргетинг на основе своих позиций с помощью :odd или :even селекторов. Обратите внимание, что jQuery индексируется с нулевой отметкой, что означает, что первый элемент в элементе выбора имеет позицию 0. Это может быть немного запутанным, как, напротив, интуитивно :odd выбирает второй элемент (позиция 1), четвертый элемент (позиция 3) , и так далее. Вот как вы бы нацеливали все нечетные элементы с помощью target $(".target:odd").addClass("animated shake"); класса и давали им классы: $(".target:odd").addClass("animated shake"); Попробуйте выбрать все четные target элементы и дать им классы animated и shake . Помните, что даже относится к позиции элементов с нулевой системой в виду.
## Instructions
## Tests
```yml tests: - text: All of the target elements that jQuery considers to be even should shake. testString: assert($('.target:even').hasClass('animated') && $('.target:even').hasClass('shake')); - text: You should use the :even selector to modify these elements. testString: assert(code.match(/\:even/g)); - text: Only use jQuery to add these classes to the element. testString: assert(code.match(/\$\(".target:even"\)/g) || code.match(/\$\('.target:even'\)/g) || code.match(/\$\(".target"\).filter\(":even"\)/g) || code.match(/\$\('.target'\).filter\(':even'\)/g)); ```
## Challenge Seed
```html

jQuery Playground

#left-well

#right-well

```
## Solution
```html

jQuery Playground

#left-well

#right-well

```