ID's in HTML are generally used as unique identifiers for the elements present in the DOM but it is not a compulsion to have only one element with a unique ID, which means you can have multiple elements with the same ID.
JQuery selector $("#idofelement") finds the first matching element with the ID but what to do if you need to apply a style to all the elements with the same ID.
Here is a solution:
You can use JQuery selector $("[id='idofelement']") to select all the elements with matching ID.
0 Comment(s)