jQuery 杂项 toArray() 方法
jQuery 教程
· 2019-03-28 20:38:43
实例
把 <li> 元素转换为数组,然后输出该数组元素的 innerHTML :
$("button").click(function(){
x=$("li").toArray()
for (i=0;i<x.length;i++)
{
alert(x[i].innerHTML);
}
});
x=$("li").toArray()
for (i=0;i<x.length;i++)
{
alert(x[i].innerHTML);
}
});
定义和用法
toArray() 方法以数组的形式返回 jQuery 选择器匹配的元素。
语法
$(selector).toArray()
点击查看所有 jQuery 教程 文章: https://www.codercto.com/courses/l/35.html
Pro Git (Second Edition)
Scott Chacon、Ben Straub / Apress / 2014-11-9 / USD 59.99
Scott Chacon is a cofounder and the CIO of GitHub and is also the maintainer of the Git homepage ( git-scm.com ) . Scott has presented at dozens of conferences around the world on Git, GitHub and the ......一起来看看 《Pro Git (Second Edition)》 这本书的介绍吧!