--- id: bad87fee1348bd9aed108826 title: Target a Specific Child of an Element Using jQuery required: - link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css' challengeType: 6 videoUrl: '' localeTitle: Segmentar um filho específico de um elemento usando jQuery --- ## Description
Você viu porque os atributos id são tão convenientes para a segmentação com seletores jQuery. Mas você nem sempre tem ids legais para trabalhar. Felizmente, o jQuery tem alguns outros truques para direcionar os elementos certos. O jQuery usa CSS Selectors para segmentar elementos. O seletor de target:nth-child(n) CSS permite selecionar todos os enésimos elementos com a classe de destino ou tipo de elemento. Veja como você daria ao terceiro elemento em cada poço a classe de rejeição: $(".target:nth-child(3)").addClass("animated bounce"); Faça o segundo filho em cada um dos seus elementos do poço saltar. Você deve selecionar os filhos dos elementos com a classe de target .
## Instructions
## Tests
```yml tests: - text: O segundo elemento em seus elementos de target deve saltar. testString: 'assert($(".target:nth-child(2)").hasClass("animated") && $(".target:nth-child(2)").hasClass("bounce"), "The second element in your target elements should bounce.");' - text: Apenas dois elementos devem saltar. testString: 'assert($(".animated.bounce").length === 2, "Only two elements should bounce.");' - text: 'Você deve usar o seletor :nth-child() para modificar esses elementos.' testString: 'assert(code.match(/\:nth-child\(/g), "You should use the :nth-child() selector to modify these elements.");' - text: Use apenas o jQuery para adicionar essas classes ao elemento. testString: 'assert(code.match(/\$\(".target:nth-child\(2\)"\)/g) || code.match(/\$\(".target:nth-child\(2\)"\)/g) || code.match(/\$\(".target"\).filter\(":nth-child\(2\)"\)/g) || code.match(/\$\(".target"\).filter\(":nth-child\(2\)"\)/g), "Only use jQuery to add these classes to the element.");' ```
## Challenge Seed
```html

jQuery Playground

#left-well

#right-well

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