FAQ: jQuery Setup - Targeting by id

This community-built FAQ covers the “Targeting by id” 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 Targeting by id

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!

what was the point of this? I saw some kind of menu with options and then after typing in hide, it was gone. It didn’t really seem to do anything special. Does this lead to having some kind of drop display menu bar? I don’t seem to notice it after hitting run.

This lesson teaches .hide(), i think that is about it. It just shows us to hide an element. Which can indeed be used to create a dropdown menu

1 Like

What is another application of using .hide() ? I’m just curious. Could it be something one would put in code before an official release of a website to make sure certain parts do not show? What else?

The only reason to use .hide() would be defer content that is already there from displaying until such time as it is meant to be exposed.

If you’re working on a project that is still awaiting completion, .hide() would be a way to conceal it, but it would be better if you just use display: none in the CSS and remove that rule when ready to show the new content.

1 Like