diff --git a/src/jquery.data.filter.js b/src/jquery.data.filter.js index 01084b1..55696c1 100644 --- a/src/jquery.data.filter.js +++ b/src/jquery.data.filter.js @@ -5,6 +5,14 @@ if (typeof value === "undefined" || value === "") { return this.filter('[data-' + attribute + ']'); } + else if (typeof value === "boolean") { + if (value) { // value === true + return this.filter('[data-' + attribute + ']') + } + else { // value === false + return this.not('[data-' + attribute + ']'); + } + } else if ($.isArray(value)) { // In the case that we have an array, we want to build a big multiple selector string: diff --git a/test.html b/test.html index d97e75d..ae1ade0 100644 --- a/test.html +++ b/test.html @@ -6,7 +6,7 @@
None
-
None
+
100
100
101