Do HTML IDs have to be unique?


Anurag Mishra

Yes, HTML ID must be unique in an HTML page. HTML does not allow duplicate id. There are a few reasons we need to understand. First of all, we need to know why id in HTML? Id is used to uniquely identify an HTML element so two-element can not have the same identity. 

Note - We can have the duplicate class name but id must be unique

0 votes

Your Answer

Email Us:

Donate Us: Support to GDATAMART

LifeStyle & Fun

© 2024 GDATAMART.COM (All Rights Reserved)