我有两个字段,即手机号码和密码
当焦点在移动号码文本字段上时,当用户按 Tab 键时,焦点不会移动到密码字段?
这是我的HTML页面
<div class="createAccountWrap">
<div class="row-fluid">
<label class="fieldLabel">Mobile Number</label>
<div class="insideInput"><input type="tel" placeholder="Mobile Number" maxlength="10" autocomplete="off" id="vmobilenum" name="vmobilenum" onkeypress="return isNumberKey(event)" required><a href="#" class=""></a></div>
</div>
<div class="row-fluid">
<label class="fieldLabel">Password</label>
<div class="insideInput"><input type="password" placeholder="Password" autocomplete="off" id="vpwdcode" name="vpwdcode" onkeypress="return nospecialCharacters(event)" required><a href="#" class=""></a></div>
</div>
</div>
你能告诉我为什么它不起作用吗?
答案 0 :(得分:4)
如果您需要空锚,请使用tabindex
元素上的 input
属性
<input tabindex="1" ...
http://jsfiddle.net/Us8uc/4372/
否则删除空锚。
a
元素也是可聚焦的元素。
答案 1 :(得分:0)
使用“tabindex”
尝试此操作<div class="createAccountWrap">
<div class="row-fluid">
<label class="fieldLabel">Mobile Number</label>
<div class="insideInput"><input tabindex="1" type="tel" placeholder="Mobile Number" maxlength="10" autocomplete="off" id="vmobilenum" name="vmobilenum" onkeypress="return isNumberKey(event)" required><a href="#" class=""></a></div>
</div>
<div class="row-fluid">
<label class="fieldLabel">Password</label>
<div class="insideInput"><input tabindex="2" type="password" placeholder="Password" autocomplete="off" id="vpwdcode" name="vpwdcode" onkeypress="return nospecialCharacters(event)" required><a href="#" class=""></a></div>
</div>
</div>