jQuery .each()这个和元素

在.each()回调中,这个和回调函数的第二个参数之间有什么区别吗?

例如,在以下代码中:

$("example").each( function(index,element) {
    // body
});

这个和元素有什么区别吗?提供的第二个参数是否可以选择一个名称

解决方法

不,没有区别;第二个参数只是为了方便起见。

Each time the callback runs,it is passed the current loop iteration,beginning from 0. More importantly,the callback is fired in the context of the current DOM element,so the keyword this refers to the element.

from 07000

最有可能的是第二个参数是与jQuery.each的一致性。

相关文章

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