jQuery 如何在jquery中获取和设置tabindex

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13913114/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 13:05:23  来源:igfitidea点击:

how to get and set tabindex in jquery

jquery

提问by Madura Harshana

Im going to set tab index,

我要设置标签索引,

$("#DilutionFactor1_" + nCount).attr(
       'tabindex',
       $("#UnitOfMeasure" + nCount).attr('tabindex')+ 1) ;

but this is not working. Anyone can help me to solve this?

但这不起作用。任何人都可以帮我解决这个问题吗?

回答by Kanishka Panamaldeniya

try to use parseInt

尝试使用 parseInt

 $("#DilutionFactor1_" + nCount).attr('tabindex',
parseInt($("#UnitOfMeasure" + nCount).attr('tabindex'))+ 1) ;