FAQ: jQuery Setup - Why jQuery?

This community-built FAQ covers the “Why jQuery?” exercise from the lesson “jQuery Setup”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Introduction to jQuery

FAQs on the exercise Why jQuery?

Join the Discussion. Help a fellow learner on their journey

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

why do I need four div and class at the beginning ? what would be the problem if we start with one?

<div class='container'>
    <div class='product-card'>
      <div class='product-photo sole-air-ii'></div>
      <div class='product-details'>```
 <div class='product-photo sole-air-ii'></div>

how does this one works ? there is nothing inside the div?
these are so confusing :disappointed:

I don’t think they were meant to do anything or maybe they are reserved for future use

This is an identified element that the script can hook on to so it can insert new content into the DOM (that will display in the page). In static pages we would not expect to see empty elements, but a dynamic page might have several. They all have a purpose in the session.

You could accept the following answer also

$('.login-button').click(() => {