禁用选项卡焦点的表单元素 [英] Disabling tab focus on form elements
本文介绍了禁用选项卡焦点的表单元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在同一个表单中有几个 div
s。我想要做的是在表单中的 div
s之一中禁用 Tab 键,而不禁用其他 div
s。
I have several div
s within the same form. What I am trying to do is to disable the Tab key in one of the div
s in the form without disabling the tab in the other div
s in the same form.
示例表格:
Example Form:
- div1 - 禁用标签
- div2 - 标签 li>
- div3 - 标签有效
- div1 - disable Tab
- div2 - Tab works
- div3 - Tab works
推荐答案
一个简单的方法是将tabindex = - 1放入您不希望被标记的字段中。
Eg
A simple way is to put tabindex="-1" in the field(s) you don't want to be tabbed to. Eg
<input type="text" tabindex="-1" name="f1">
这篇关于禁用选项卡焦点的表单元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文