My function returns a filtered (array) list of items based on the data attribute.
I would like it if I could make this function chainable:
$(document).ready(function (){
function filterSvcType (svcType) {
var selectedServices = $("#service-list div");
var chose = selectedServices.filter(function() {
return $(this).data("service-type") == svcType;
});
console.log(chose);
}
filterSvcType("hosting");
});
What I want to do is call it like this:
filterSvcType("hosting").fadeOut();
How do I do this?