I answered hundreds of jQuery questions. One of the common beginner mistakes is the use of several element identifiers, for example:
<div id="a">....</div> <div id="a">....</div>
Then they will do something like this and ask why it is not working properly:
$('#a').hide();
I usually answer:
IDs must be unique
... to which someone always answers:
But not in HTML5!
Question So, if multiple identical identifiers are allowed in HTML5, how should scripts handle them, or should we still avoid using multiple identical identifiers for elements?
Diodeus - James MacFarlane
source share