jQuery first of type selector?

后端 未结 6 2029
独厮守ぢ
独厮守ぢ 2021-01-03 18:35

How would I select the first

element in the following

with jQuery?

heading

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-03 19:31

    $('div p:first')
    

    answer was too short to post without this useless sentence.

    Edit This is definitely a slow option. After looking at Jame's speed test, it looks like jQuery selectors work best when they piggy back off of css selectors.

提交回复
热议问题