Are empty IDs considered duplicate?

Question

If there are multiple elements with empty IDs, are they considered duplicate?

Answer

Generally no, we would not consider those as duplicate but it is situational. We do recommend removing empty IDs from a clean code perspective, but it is not something that would necessarily fail a WCAG audit without further investigation.

A failure for duplicate, empty IDs would look something like this (3 checkboxes with empty id attributes):

<div> 
   <input type="checkbox" id=""> 
   <label for="">Choice 1</label>
   <input type="checkbox" id=""> 
   <label for="">Choice 2</label>
   <input type="checkbox" id="">
   <label for="">Choice 3</label>
</div>