12. ID, please! Question about difference between class and ID



Classes and ID's both seem to be more or less the same to me. It says ID's are for only singular or whatever elements while classes are for many. Yet it asks me to implement in this lesson and the lesson before it both of these features in the same way, which to me means there's no real difference. Can someone explain this to me? Maybe a bit better than these lessons did?


You want to understand the differences between ids and classes or use cases when one is more suitable than the other?


This question has definitely already been asked on the forum, please search a bit before you ask :slight_smile:


browser these days unfortunate support using the same id name multiply times, but they are still different (especially when using javascript and jquery), also if a html element has an id and class, the id will be applied because it is more powerful


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.