Do HTML IDs have to be unique?

By: Lakshay Gupta | 13 June 2019

A

Anurag Mishra

15 April 2020

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

Advertise With Us

Email us for details: advertise@gdatamart.com

Legal Policy
Sitemap & Support
International
© 2021 GDATAMART.COM (All Rights Reserved)