Is there a way I can use a jQuery pseudo selector like :empty
or :not(:checked)
on an input/textarea/select element, or any other way I can return an object that is empty?
views:
92answers:
2
+2
A:
I'm not entirely clear, but I think you're looking for input controls that have no value entered by the user? There's no explicit pseudo-selector/filter for that, but...
You can build a custom filter by using the .filter()
function on your result set. Try something like:
$("input").filter(function (){
return $(this).val() == '';
});
womp
2009-12-18 19:59:25
A:
Not tested it but this should work too
$('input[value=""], select[option=""]')
as selector.
asrijaal
2009-12-18 20:11:46