jquery – 使用.first()和.eq(0)之间有什么区别?

参见英文答案 > Are jQuery’s :first and :eq(0) selectors functionally equivalent?                                    3个
使用这两种方法检索集合中的第一个元素有什么区别?

解决方法

取自jQuery 1.7.1的 live source code

,first:function(){return this.eq(0)},last:function(){return this.eq(-1)}

所以你怀疑.first()只是一个调用.eq()的包装器.

结论:没有任何区别.

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...