title: Is there a unique identifier for a JavaScript DOM element even when id is not specified?
body: <p>In the following code example there are 3 div elements, none have an ID but each one is able to be uniquely accessed by being returned into an array. I'm wondering how JavaScript is keeping track of them? Is the browser assigning each object a unique reference? Is this unique reference discoverable or an attribute somewhere? Or is all that handled internally? </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;style type="text/css"&gt;
      div {
        width: 150px;
        height: 150px;
        background-color: red;
        margin: 10px;
      }
    &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div&gt;&lt;/div&gt;
      &lt;div&gt;&lt;/div&gt;
      &lt;div&gt;&lt;/div&gt;
  
      &lt;script type="text/javascript"&gt;
        var divArray = document.getElementsByTagName("div");
        for (var i=0; i&lt;divArray.length; i++){
          divArray[i].onclick = function(){
            this.style.display = "none";
          }
        }
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>