I have the below HTML DOM
You can pass in a filter function rather than a selector:
$('#container input[type="text"]').filter(function () {
return !!this.value;
}).length;
The attribute value will always be the default value so you must filter through the input boxes and check the value like this code below
$('#container input[type="text"]').filter(function () {
return this.value.length > 0
}).length;
DEMO