Created
July 29, 2014 21:28
-
-
Save zeroasterisk/6b45054844f0b961e3dd to your computer and use it in GitHub Desktop.
Custom jQuery selector for Input values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Custom jQuery selector | |
* :val("inputvalue") | |
* | |
* usage: $('input:val("foo")') | |
*/ | |
jQuery.extend(jQuery.expr[':'], { | |
val: function (el, i, meta) { | |
return meta[3] == jQuery(el).val(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment