What are attributes (like id) supposed to do?

I see that in this lesson,

https://www.codecademy.com/paths/learn-how-to-build-websites/tracks/build-websites-intro/modules/learn-html-elements/lessons/intro-to-html/exercises/attr-html

You are adding ids to the divs. I don’t see how they visually impact the website. Are they like // (insert text for reference here) in javascript or are they more?

Once you site grows, you will get the same elements (for example div or p) multiple times, we could use id’s to distinguish between the same elements, for styling purposes for example

or associate a label with an input field

i just recommend continuing with the course, you will come across more usage of id

1 Like

Thank you, I just did that and realized they are actually very useful

1 Like

you will run into this more often, that a concept is explained first, and you might not see all use case right away.

2 Likes