title: JQuery on dynamically creating element and attaching data does not return value when calling data() again using selector?
body: <p>I create a div element dynamically and associate <code>data()</code> to it. When accessing it again via selector it does not return the data. As result of below snippet I see first alert with data '1' and another with 'null' value. Can someone please help.</p>
  
  <pre><code>var dc = 0;
  $("#attachData").click(function () {
           dc++;
    var newDiv = jQuery('#oldid').clone();
    newDiv.attr('id', 'dt'+dc);
    jQuery.data(newDiv, "dd", '1')
  
     alert(jQuery.data(newDiv, "dd"));
  
   var divFromSelector = $('#dt'+dc);
   alert(jQuery.data(divFromSelector, "dd"));
  });
  </code></pre>
  
  <hr>
  
  <p>Sorry, I did not add it in the snippet but its attached to the tree:</p>
  
  <pre><code>newDiv.attr('id', 'dt'+dc).
  appendTo('#workspace-container'); 
  </code></pre>
  
  <p>Also when I try to access it using selector the element is returned correctly - but no data found.</p>