target:nth-child(n)
CSS selector allows you to select all the nth elements with the target class or element type.
Here's how you would give the third element in each well the bounce class:
$(".target:nth-child(3)").addClass("animated bounce");
Make the second child in each of your well elements bounce. You must select the elements' children with the target
class.
target
elements should bounce.
testString: assert($(".target:nth-child(2)").hasClass("animated") && $(".target:nth-child(2)").hasClass("bounce"), 'The second element in your target
elements should bounce.');
- text: Only two elements should bounce.
testString: assert($(".animated.bounce").length === 2, 'Only two elements should bounce.');
- text: You should use the :nth-child()
selector to modify these elements.
testString: assert(code.match(/\:nth-child\(/g), 'You should use the :nth-child()
selector to modify these elements.');
- text: Only use jQuery to add these classes to the element.
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.');
```