I\'m using the below selector to get all the form inputs that are pre-populated with a value.
$(\'input[value!=\"\"]\');
This works great a
$('select').has('option[selected="selected"]')
will get the select element. jsFiddle example.
For select you need to use a special selector made available by JQuery: :selected
So
$('#state option:selected').val()
is the current selected value.
If you need the do something on the select elements themself you could do something like:
$('#select option:selected').parents('select').dosomething(...)
value
is not an attribute of select
tag.
So you need to try:
var emptySelect = $('select').filter(function() {
return $.trim( $(this).val() ) == '';
});