data attribute retrieve method doesn't work
when yo set data attribute html5 using this way:
$('#element').data('some-att-name', value);
it doesn't work to retrieve with this method: $("ul").find("[data-slide='" + current + "']"); so you need use the classic method to add a attribute:
$('<li>'+name+'</li>').attr('data-name',name);
this note appears in small letters in a stack overflow question.
$('#element').data('some-att-name', value);
it doesn't work to retrieve with this method: $("ul").find("[data-slide='" + current + "']"); so you need use the classic method to add a attribute:
$('<li>'+name+'</li>').attr('data-name',name);
this note appears in small letters in a stack overflow question.
Comments
Post a Comment