Home › Forums › JavaScript › Small jQuery plugin dilemma › Reply To: Small jQuery plugin dilemma
August 26, 2014 at 2:23 pm
#180756
__
Participant
Duplicate id
s are invalid, but that doesn’t always matter. Different browsers do different things, but I think the main problem you’d have would be with javascript: getElementById
usually (in most browsers, AFAIK) only returns the first match. So, there’s potential for conflicting code and general funkyness if the user tries to attach some other functionality to the id
…
Sorry; I don’t really have a suggestion. Your best bet, I think, is #1, combined with a big warning against giving the menu an id
in your README.
Maybe you could mix a little bit of #2 in there by logging a warning in the console when you find an id
.