开发者

in jquery, how to select current element's first child?

开发者 https://www.devze.com 2023-01-01 07:26 出处:网络
$(this) //this refer 开发者_开发问答to the elem how to get the first child of \'this\'?$(this).children().eq(0)

$(this) //this refer 开发者_开发问答to the elem

how to get the first child of 'this'?


$(this).children().eq(0)

or

$(this).children(':first')

or

$(this).children(':eq(0)')

or simply without jQuery:

this.firstChild
0

精彩评论

暂无评论...
验证码 换一张
取 消