+ 3
I dont understand. whats the difference between class and id they both exibits same properties. What class makes differ from id?
7 ответов
+ 2
than you
+ 2
Well, ID is unique and Class isn't. You can call a lot of classes with the same function. I think that is it.
+ 1
ID can be used in CSS, but it's more of a fiture of Java Script. Usually we use classes for CSS and IDs for JS
0
Different elements in html can have the same class.
But id is used to uniquely identify an element.
- 1
generally classes are used for styling, thus several parts may have same styles, and id is used for JavaScript actions
and, in css styling id has greater priority than class
- 1
pinherio, yeah! that's called auto increment:)