title: Best way to assign a javascript object to html element
body: <p>I'm getting a javascript object via ajax. I need to attach this object to a div in order to be recovered later, for example, on a click event. </p>
  
  <p>If instead of an object I had a variable I would push it into the html tags like this: </p>
  
  <pre><code>'&lt;div variable="'+value+'"&gt;&lt;/div&gt;';
  </code></pre>
  
  <p>And I would recover its value like this:</p>
  
  <pre><code>var value= $(this).attr('variable')
  </code></pre>
  
  <p>Could you suggest me a good approach to do that with objects? </p>
  
  <p>Thank you very much!</p>