tabIndex属性是TAB键在页面中的移动顺序,即焦点的顺序。移动顺序是从tabIndex属性数值最小的开始,从小往大,如果下一个焦点tabIndex属性值是(-1)视为无效不能得到焦点。
你的姓名: <input type="text" name="ming" tabindex="1"><br> 你的地址(不是必填): <input type="text" name="dizhi" tabindex="-1"><br> 你的手机: <input type="text" name="shouji" tabindex="3"><br> 你的学历(不是必填): <input type="text" name="xueli" tabindex="-1"><br> 你的邮箱: <input type="text" name="youxiang" tabindex="4"><br> <p style="color: red">您可以使用键盘Tab快速填写 必填项</p>
<元素名 tabindex="数值">
规定元素的 tab 键控制次序(1 是第一个)