jquery filter on data attribute code example
Example: jquery filter data
var $previous = $('.navlink').filter(function() {
return $(this).data("selected") == true
});
var $previous = $('.navlink').filter(function() {
return $(this).data("selected") == true
});