title: Find div with class and add HTML5 data attribute?
body: <p>I'm trying to find a div with a specific class or id, then adding a custom HTML5 data attribute to it. For example:</p>
  
  <p>Find:</p>
  
  <pre><code>&lt;div class="mydv"&gt;Hello&lt;/div&gt;
  </code></pre>
  
  <p>Then add data-customtype="one" so it becomes</p>
  
  <pre><code>&lt;div class="mydv" data-customtype="one"&gt;Hello&lt;/div&gt;
  </code></pre>
  
  <p>However, the following code does not seem to work:</p>
  
  <pre><code>$('.mydv').data('customtype','one'); 
  </code></pre>