基于tabindex查找元素 [英] find element based on tabindex
本文介绍了基于tabindex查找元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用jquery或javascript,如何在DOM中找到设置了特定tabindex的输入元素,例如。
Using jquery or javascript, how can I find the input element in the DOM that has a particular tabindex set to it, eg.
<input id="txtInput" type="text" maxlength="5" tabindex="7">
如果我在使用tabindex = 7搜索元素,我希望返回此元素。
I would want this element returned if I was searching for the element with tabindex = 7.
推荐答案
您可以使用以下jQuery获取它
You can get it with the following jQuery
$('input[tabindex=7]')
这篇关于基于tabindex查找元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文