Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72416

focus next input after condition....in ul list jquery

$
0
0

I was looking for similar responses on this site, but I wasn't able to make my code work.

What am doing wrong?

Requested

I want to focus the next input after alert();

I know I need to use next() function but...for some reason I dont get it.

working code below

		  $(".insertWord input").on("input",function() {
							var matchWord=$(this).attr("title");
					if($(this).val()===matchWord ){ alert();
						$(this).closest('.insertWord input').next().focus();
					}		
  });
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script><ul class='words'><li class='insertWord'><input title='abc' /></li><li class='insertWord'><input title='mnp' /></li></ul>

Viewing all articles
Browse latest Browse all 72416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>