How to select all input tag in without certain attribute and checks each input value not empty in Jquery
Html
<input type="text" maxlength="255" value="" id="UserName" class="form-error" >
<input type="text" maxlength="255" value="" id="Password" class="form-error">
<input type="text" maxlength="255" value="" id="Group" class="form-error" inputname="test" >
<input type="text" maxlength="255" value="" id="Aka" class="form-error" inputname="money" >
I want to select all inputs from the current page which dont have attribute as 'inputname'.
Something like
In javascript
var inputs = $('input:not(:has(>[inputname]))');
jQuery.each(inputs, function(input) {
if (input.value == '') {
$(input).next().removeClass('displayNone');
return false;
}
});
I believe you want
var inputs = $('input:not([inputname])');
Live example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With