$(".dum").click(function() {
    document.getElementById("ev").value=$(this).attr("data-name");
   
    $("#test-form").dialog("open");
});// this is just the test
 
 
cell2.innerHTML = '<span  class="dum" style="color:'+testvalues[i]+'; font-size:20px;">'+testvalues[i + 2] || ''+'data-name=" '+testvalues[i+2] +'">'+ '</span>';
<div id="test-form" title="Event Information">
 <p>Event:</p> 
 <input id= "ev" type="text"  name="fullname" disabled />
</div>I have a <span> where I have values from db. And I am trying to get those value to a input box using jquery attr but I am getting undefined. The attr name is "data-name". I do not know what I am doing wrong here. I will be very thankful for any help.
 
     
     
     
    