--- 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 videoUrl: '' localeTitle: Alvo mesmo elementos usando jQuery --- ## Description
Você também pode segmentar elementos com base em suas posições usando :odd ou :even seletores :even . Note que o jQuery é zero-indexado, o que significa que o primeiro elemento em uma seleção tem uma posição 0. Isso pode ser um pouco confuso, pois, intuitivamente :odd seleciona o segundo elemento (posição 1), quarto elemento (posição 3) , e assim por diante. Aqui está como você iria direcionar todos os elementos ímpares com a classe target e dar-lhes classes: $(".target:odd").addClass("animated shake"); Tente selecionar todos os elementos do mesmo target e dar a eles as classes de animated e shake . Lembre-se que até se refere à posição dos elementos com um sistema baseado em zero em mente.
## Instructions
## Tests
```yml tests: - text: Todos os elementos de target que o jQuery considera serem pares devem se movimentar. testString: 'assert($(".target:even").hasClass("animated") && $(".target:even").hasClass("shake"), "All of the target elements that jQuery considers to be even should shake.");' - text: 'Você deve usar o seletor :even para modificar esses elementos.' testString: 'assert(code.match(/\:even/g), "You should use the :even selector to modify these elements.");' - text: Use apenas o jQuery para adicionar essas classes ao elemento. testString: 'assert(code.match(/\$\(".target:even"\)/g) || code.match(/\$\(".target:even"\)/g) || code.match(/\$\(".target"\).filter\(":even"\)/g) || code.match(/\$\(".target"\).filter\(":even"\)/g), "Only use jQuery to add these classes to the element.");' ```
## Challenge Seed
```html

jQuery Playground

#left-well

#right-well

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