Asked 2 years ago
20 May 2022
Views 793
eclipse-learner

eclipse-learner posted

html validator Error: Duplicate ID found.

i get the following error for the w3c validator test :


Error: Duplicate ID spec.
From line 2101, column 2; to line 2101, column 19
>?	</h2>?	<div id="spec">?	<div


how do solve this problem with a validator?
kord

kord
answered May 20 '22 00:00

so your html must have more than elements which have same value of id attribute
so unique id value is not good practice in html
suppose

	<div id="spec">  </div>
	<span id="spec">  </span>
	<a id="spec">  </a>


so above HTML is not good practice because it has three elements have the same id "spec" so you should remove the id and give another unique id name to the any of two elements.
Post Answer