JavaScript / JQuery从tabindex中删除 [英] Javascript/JQuery remove from tabindex

查看:441
本文介绍了JavaScript / JQuery从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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆