target:nth-child(n)
селектор target:nth-child(n)
CSS позволяет вам выбрать все n-ые элементы с целевым классом или типом элемента. Вот как вы бы дали третий элемент в каждой скважине класс отказов: $(".target:nth-child(3)").addClass("animated bounce");
Сделайте второго ребенка в каждом из элементов вашего колодца. Вы должны выбрать дочерние элементы элементов с target
классом.
target
elements should bounce.
testString: assert($(".target:nth-child(2)").hasClass("animated") && $(".target:nth-child(2)").hasClass("bounce"));
- text: Only two elements should bounce.
testString: assert($(".animated.bounce").length === 2);
- text: You should use the :nth-child()
selector to modify these elements.
testString: assert(code.match(/\:nth-child\(/g));
- 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));
```