Using DOM elements as keys to javascript map
<p>I am trying to associate some "private" data with DOM elements.  Rather than adding that data to the DOM element itself (I'd like to avoid changing the DOM element), I have a separate data object that I want to use as a map.</p>

<p>Rather than:</p>

<pre><code>document.GetElementById('someElementId').privateData = {};
</code></pre>

<p>I want to do</p>

<pre><code>internalPrivateDataMap[document.GetElementById('someElementId')].privateData = {};
</code></pre>

<p>Not all the elements have an id field, and some are created dynamically, so I can't use the id as the key.</p>

<p>This works fine for most elements, but for "a" elements, the key being used seems to be the href of the element, I think because the DOM defines a toString() function for a elements.</p>

<p>The result of this is that if I have two "a" elements with the same href, they are sharing privateData, which I don't want.  </p>

<p>My current workaround is to generate an internal uniqueID I can use as a key, but that requires me to modify the DOM element, which I am trying to avoid.</p>
