$.fn.filterData = function (k, v) { return this.filter(function () { return ($(this).data(k) == v); }); };