Now, I'm going to make a note here again, if we move on to the next lesson, you should know that
an ID needs to be unique.
So if you go and inspect the elements here.
We can see that we have 2H2 elements with the ID of red.
So we can see they're both red, but it's not really valid HTML because an ID needs to be unique.
So if I go ahead and check the jQuery again and say dollar sign.
Read the text.
We only get the first element in the HTML document because jQuery is built so that IDs there is only
one of those.
So make sure.
So this is just a little note for you to be aware of, because sometimes web developers do make mistakes
and make multiple IDs with the same name, which you are not supposed to.
But what if you want to have multiple elements and the web developer wants to have them in one style?
Well, then you have something which is called classes.
So if you move on to the next lesson, we have classes now.
So you simply say H2 class is equal to read in the HTML.
And then up in the CSS, we have a dot red instead of a hashtag red.
So that is using a class and classes.
That is fine when you have multiple elements with the same class.
So if you go inside and make sure to inject jQuery and then you can say dollar sign with the dot, just
like the CSS we had inside the file and say read and say dot text.
We see.
We now get both of the elements.
Text with the red class.
So that means that classes in HTML and CSS and also for CSS selector in jQuery have a dot in front and
IDs have a hash tag.
So classes are with a dot in front.
Just like that.
When we have multiple elements we want to select with the same class.
You can also combine these things.
You can combine it so that you have both a class and an element.
If you click here on select an element to inspect it and hover over this red element, here you can
see it says H2 dot Red.
You can also use that selector in here.
So we can say H2 dot red and say dot text.
And then we have selected all of the H2 elements with the red class.