in this challenge I have a doubt the code $(".target:nth-child(3)").addClass(“animated bounce”);, how does it find out the child of which parent I am talking about
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36.
Challenge: Target a Specific Child of an Element Using jQuery
So, jQuery targets the element class at first and then look for the nth child. Here’s a detailed explanation:
↓//declared to look for the nth child
$(".target:nth-child(3)")←//Then ask it to look for the 3rd child
↑//jQuery finds all element that have a class target
No problem. Glad I helped. Don’t be scared to ask questions, that’s why this forum exist, so you can ask for help and explanation. Now you understand how it works.
Happy Coding!!