Tip: Click lines to highlight, hold ctrl/cmd to multi-select

filterData plugin (3-Apr @ 15:42)

Useful to filter a jQuery selector by the data attached to the element.

remy

Syntax Highlighted Code

  1. $.fn.filterData = function (k, v) {
  2.     return this.filter(function () {
  3.         return ($(this).data(k) == v);
  4.     });
  5. };

Plain Code

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

Codedump Run

Permalink: http://codedumper.com/filterdata-plugin