扫码关注官方订阅号
$(this).next('input').focus();
学习是最好的投资!
if(this.nextElementSibling.tagName=="INPUT"){ this.nextElementSibling.focus() }
var node = this.nextElementSibling; while(node) { if (node.nodeType == 1) { // 检查是否是元素节点,此处非必要,只用检查tagName即可 if (node.tagName == "INPUT") { node.focus(); break; } else { node = node.nextElementSibling; } } }
我写的这个是循环获取,楼主可以自己修改达到想要的效果哦。
this.nextSibling.nextElementSibling.focus();你试试
this.nextSibling.nextElementSibling.focus();
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
我写的这个是循环获取,楼主可以自己修改达到想要的效果哦。
this.nextSibling.nextElementSibling.focus();你试试