<分区>
我们如何使用 jquery 选择页面的第一个 div?
<分区>
我们如何使用 jquery 选择页面的第一个 div?
最佳答案
jQuery 首先选择: http://api.jquery.com/first-selector/
The :first pseudo-class is equivalent to :eq(0). It could also be written as :lt(1). While this matches only a single element, :first-child can match more than one: One for each parent.
示例:
var div = $('div:first');
fiddler 示例: http://jsfiddle.net/wBQfm/
关于jquery - 使用 jquery 选择第一个 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13316869/