input 输入自动下一个,6个数字框输入效果缩略图
<div class="get-group">
	<input type="tel" maxlength="6" class="pwd-input" >  
	<div class="get-inputs">
		<input type="tel" maxlength="1" class="weui-input">
		<input type="tel" maxlength="1" class="weui-input">
		<input type="tel" maxlength="1" class="weui-input">
		<input type="tel" maxlength="1" class="weui-input">
		<input type="tel" maxlength="1" class="weui-input">
		<input type="tel" maxlength="1" class="weui-input">
		<div class="space"></div>
	</div>
</div>
<script type="text/javascript">
	var $input = $(".get-inputs input");
	$(".pwd-input").on("input", function() {  
		var pwd = $(this).val().trim();  
		for (var i = 0, len = pwd.length; i < len; i++) {  
			$input.eq("" + i + "").val(pwd[i]);  
		}  
		$input.each(function() {  
			var index = $(this).index();  
			if (index >= len) {  
				$(this).val("");  
			}  
		});  
		if (len == 6) {  
			window.location.href="index.html";
		}  
	});  
</script>

By lxcss

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注