Q
Which statement about id and class attributes is correct?
-
A
An id must be unique in the document; a class can be shared by many elements
-
B
Both must be unique
-
C
A class must be unique
-
D
An id can be repeated freely
Correct Answer:
A. An id must be unique in the document; a class can be shared by many elements
Explanation:
Duplicate ids break getElementById and label associations.