title: Storing object ID in HTML document: id vs data-id vs?
body: <p>I would like to have an opinion on storing RESTful object IDs in document for accessing it later from JavaScript.</p>
  
  <p>Theoretically speaking using <code>id</code> for addressing elements in HTML doesn't cut it anymore. Same element can be repeated twice on the page say in "Recent" and "Most Popular" queries which breaks the main point of using id.</p>
  
  <p>HAML even has this nice syntax sugar:</p>
  
  <pre><code>%div[object]
  </code></pre>
  
  <p>becomes:</p>
  
  <pre><code>&lt;div class="object" id="object_1"&gt;
  </code></pre>
  
  <p>But like I said, seems that it is not a good approach. So I am wondering what is the best way to store objects id in DOM? </p>
  
  <p>Is this the current proper approach?</p>
  
  <pre><code>&lt;div data-id="object_1"&gt;
  </code></pre>