jquery filter based on data 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
});