How would I select the first element in the following with jQuery? heading 6条回答 梦毁少年i (楼主) 2021-01-03 19:17 $("div p").first(); or $('div p:first'); Reference: http://api.jquery.com/first/ Keep in mind that first() matches only a single element, the :first-child selector can match more than one: one for each parent. 0 讨论(0) 查看其它6个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
with jQuery? heading 6条回答 梦毁少年i (楼主) 2021-01-03 19:17 $("div p").first(); or $('div p:first'); Reference: http://api.jquery.com/first/ Keep in mind that first() matches only a single element, the :first-child selector can match more than one: one for each parent. 0 讨论(0) 查看其它6个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
heading
$("div p").first();
or $('div p:first');
Reference: http://api.jquery.com/first/
Keep in mind that first() matches only a single element, the :first-child selector can match more than one: one for each parent.