title: Jquery Attr Returns Undefined
body: <p>Jquery</p>
  
  <p>Im creating div and adding attr in loop. And in other function i need to access it but it returns <code>undefined</code> and <code>.data("color",value)</code>(set) and <code>.data("color")</code>(get) is not working for me is there any diffirent way for getting or setting for custom attribute</p>
  
  <pre><code>$("#"+i+"-"+j).attr("data-color",a);
  </code></pre>
  
  <hr>
  
  <pre><code>var bColor = $("#"+newX+"-"+j).attr("data-color");
  
  console.log(bColor);
  </code></pre>