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