JavaScript / JQuery从tabindex中删除 [英] Javascript/JQuery remove from tabindex
问题描述
在一个HTML表单中,我有INPUT文本框,然后是一个链接,然后是另一个INPUT文本框。我想从tabindex / tab顺序中删除链接:
< p>
< input type =textname =field1id =field1value =/>
< a href =.. a url ..id =link1>更多信息< / a>
< / p>
< p>
< input type =textname =field2id =field2value =/>
< / p>
标签顺序是field1,link1,field2,我希望它是field1,field2不带link1 tabindex /订单。除了通过 tabindex
属性进行重新排序外,还有什么办法可以从链接中删除链接1吗?
< p>
< input type =textname =field1id =field1value =/>
< a href =#id =link1tabindex = - 1>更多信息< / a>
< / p>
< p>
< input type =textname =field2id =field2value =/>
< / p>
您也可以使用jquery来执行此操作:
$('#link1')。prop('tabIndex',-1);
On an HTML form I have INPUT text box followed by a link, then followed by another INPUT text box. I want to remove the link from the tabindex / tab order:
<p>
<input type="text" name="field1" id="field1" value="" />
<a href="..a url.." id="link1">more info</a>
</p>
<p>
<input type="text" name="field2" id="field2" value="" />
</p>
The tab order is field1, link1, field2 and I want it to be field1, field2 without link1 in the tabindex / order at all. Aside from reordering via the tabindex
attribute, is there any way to remove link1 from tabbing altogether?
You can achieve this with html:
<p>
<input type="text" name="field1" id="field1" value="" />
<a href="#" id="link1" tabindex="-1">more info</a>
</p>
<p>
<input type="text" name="field2" id="field2" value="" />
</p>
You could also use jquery to do this:
$('#link1').prop('tabIndex', -1);
这篇关于JavaScript / JQuery从tabindex中删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!