+ 1
What's the difference between Id and Class type selectors because they seem to work the same way?
I've applied id to more than one element and still works
3 odpowiedzi
+ 5
Here is an example of how id and class work. Take a look at JavaScript code and you'll see.
When we change style of element chose by id, it applies to first element only.
And when we change style of element chose by class, we need to define which element we want to style, [0] or [1], and we can apply it to both elements.
Write a comment if you need more explanation.
https://code.sololearn.com/WoY5rN4SATDn/?ref=app
+ 3
It's clear now. thanks
0
I'd is used to call divs when styling