Crazy Horse
asked on
how to use .length with "input"
I have two text fields which are pretty much the same. The only difference is that one has a name of "name" and the other a name of "surname".
I am trying to not use ID's but rather just "input" to trigger a loader when either has text inputted.
The loader should only display after 3 characters are entered. With this code, the loader appears after typing only one character.
Secondly, how can I get the loader to show in the text box that has text being entered into it?
I am trying to not use ID's but rather just "input" to trigger a loader when either has text inputted.
$(document).ready(function(){
$("input").keyup(function(){
if("input".length >3){
$(".loader").show();
}
});
});
The loader should only display after 3 characters are entered. With this code, the loader appears after typing only one character.
Secondly, how can I get the loader to show in the text box that has text being entered into it?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window