0

同じクラス名を持つページに多くの div があります。jqueryを使用して、特定のクラス名を持つ2番目のdivのみを選択するにはどうすればよいですか? ありがとうございました!!

4

1 に答える 1

4

.eq以下のような関数を使用できます。

$(selector).eq(1) //should return you the second element of the matching selector.

:eq()または、以下のようなセレクターを使用できます。

$('selector:eq(1)') //should return you the second element of the matching selector.
于 2012-11-12T15:38:26.163 に答える