diff options
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/js.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js index 8cfb58982ad..5846d289880 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -401,3 +401,10 @@ if (!Array.prototype.map){ return res; }; } + +/** + * Filter Jquery selector by attribute value + **/ +$.fn.filterAttr = function(attr_name, attr_value) { + return this.filter(function() { return $(this).attr(attr_name) === attr_value; }); +}; |