Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
同じクラス名を持つページに多くの div があります。jqueryを使用して、特定のクラス名を持つ2番目のdivのみを選択するにはどうすればよいですか? ありがとうございました!!
.eq以下のような関数を使用できます。
.eq
$(selector).eq(1) //should return you the second element of the matching selector.
:eq()または、以下のようなセレクターを使用できます。
:eq()
$('selector:eq(1)') //should return you the second element of the matching selector.