LoginSignup
5
6

More than 5 years have passed since last update.

jQueryで次の可視要素 :visible を取得する

Posted at

jQueryで次の要素を1つ取得するには.next()を使う。

$(this).next()

jQueryで次の要素を全部取得するには.nextAll()を使う。

$(this).nextAll()

次の可視要素を1つ取得するには:visibleフィルタをかける。
このとき次の1つ目の要素が確実に:visibleなのか不定なので、.next()ではなく.nextAll()を使う。
:firstフィルタを同時に用いて.next()と同様に1つ目を取得する。

$(this).nextAll(':visible:first')
5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6