How to select all input tags without a specific attribute and verify that each input value is 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 the inputs from the current page that do not have an attribute like 'inputname'.
Sort of
In javascript
var inputs = $('input:not(:has(>[inputname]))'); jQuery.each(inputs, function(input) { if (input.value == '') { $(input).next().removeClass('displayNone'); return false; } });
source share