How can I tell if two elements on the same page have the same ID?
<p>I am developing a component which will be running on foreign sites.
How can I tell if a specific ID appears more than once on the page?
I need to know this in order to make sure that an element which is supplied to me "from the outside" is unique in that sense.</p>

<p>I have tried identifying this using both document.getElementById and document.querySelector, but both seem to return the first element with the non unique ID, rather than both.
jQuery and Sizzle were no help either, as they use those very same methods.</p>
