how to get a custom data value from a highlighted class element using jquery?
this does not work…
$("#list li.highlight").attr("data-keyValue"); <— is this possible with another syntax for this to work?
$('#list').append('<li data-keyValue= "' + list_keyValue + '">' + list_dataValue + '</li>');
.highlight
{
background-color: white;
color: black;
}
you can use
dataas jquery converts uppercase to lower-case you have to usedata(keyvalue)courtesy @Rob Whttp://jsfiddle.net/F7jDJ/3/