如何使用javascript设置tabindex [英] how to set tabindex using javascript
本文介绍了如何使用javascript设置tabindex的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用javascript为HTML输入项设置tabindex属性
我尝试了以下
how can I set tabindex property for an HTML input item using javascript
I tried the following
function onPageLoad()
{
if(condition)
{
document.getElementById("fieldName").tabindex =12;
alert(document.getElementById("fieldName").tabindex);
}
}
好吧,它会警告"12",这很好,但是tabindex属性不适用于此元素,而适用于静态设置的其他元素...
在此先感谢...
well , it alerts ''12'' and that''s good , but the tabindex property doesn''t work for this element , while it works for other elements that are set statically ...
thanks in advance ...
推荐答案
选中此
使用JavaScript获取,设置和删除tabindex值 [
Check this
Getting, setting, and removing tabindex values with JavaScript[^]
如果我没记错的话,应该使用tab I ndex代替tab i ndex.
您可以在 http://www.w3schools.com/jsref/prop_html_tabindex.asp [ ^ ]
问候
Mayank Kukadia
If I am not wrong, you should use tabIndex instead of tabindex.
you can check it at http://www.w3schools.com/jsref/prop_html_tabindex.asp[^]
Regards
Mayank Kukadia
这篇关于如何使用javascript设置tabindex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文