Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeroasterisk/6b45054844f0b961e3dd to your computer and use it in GitHub Desktop.
Save zeroasterisk/6b45054844f0b961e3dd to your computer and use it in GitHub Desktop.
Custom jQuery selector for Input values
/**
* 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