-3

我试过了:

$(this).nextAll("input").get(0)

它不仅不起作用,而且看起来如果它起作用了,那将是矫枉过正。

4

2 回答 2

6
//child
$(this).children('input');

//descendant
$(this).find('input');
$('input', this);

顺便说一句,.nextAll是给兄弟姐妹的。

于 2013-01-08T21:02:38.227 回答
3

简单地使用这个:

$('input', this)

如果您需要 DOM 元素并且没有 jQuery 包装的元素,请使用

$('input', this).get(0)

nextAll不寻找孩子,而是寻找兄弟姐妹。这就是您的代码无法正常工作的原因。

于 2013-01-08T21:02:10.707 回答