Which attribute is used to specify a unique identifier for an HTML element?
Correct answer
A. id
12 views
A. id
12 views
The id attribute gives an element a unique identifier; its value must not be repeated anywhere else on the same page. It is used for CSS (#header), for JavaScript (getElementById) and for in-page links.
class, by contrast, can be shared by many elements.
Keep preparing with more Computer Science MCQs on MCQsExam.com.
Not sure why the answer is A? Ask here and get an explanation.