Tag: 专注于

使用Jquery在关键后关注下一个输入

注意:我的页面只有文本框。 没有其他的。 (没有别的=>没有其他输入类型) $(“:input[type=’text’]”).keyup(function(event){ if(valid) { // take a focus to next input element, which is again a text type. } }); 如何在按键后将焦点跳到下一个输入元素。 Sarfraz回答: – // sarfraj — here it crash Please check below for error. 从firebug问题是 $(this).next(“[type=\”text\”]”)[0] is undefined [Break On This Error] $(this).next(‘[type=”text”]’)[0].focus();