ids are unique
- Each element can have only one
id
- Each page can have only one element with that
id
classes are NOT unique
- You can use the same
class on multiple elements.
- You can use multiple
classes on the same element.
Javascript cares
JavaScript people are already probably more in tune with the differences between classes and ids. JavaScript depends on there being only one page element with any particular id, or else the commonly used getElementById function couldn't be depended on.