troubleshooting Question

how to use .length with "input"

Avatar of Crazy Horse
Crazy HorseFlag for South Africa asked on
jQuery
2 Comments1 Solution139 ViewsLast Modified:
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.

$(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
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros