Your are trying to get attribute, use attr()
for it with complete name of attribute:
var name = "data-cityid";
alert($("#myid").attr(name));
1
solved Get value using data [closed]
Your are trying to get attribute, use attr()
for it with complete name of attribute:
var name = "data-cityid";
alert($("#myid").attr(name));
1
solved Get value using data [closed]