jQuery pushStack()方法
jQuery 教程
· 2019-03-28 20:59:50
实例
向 jQuery 栈中先压入一些元素,然后再删除它们,之后再退回到之前刚压入栈的状态。
<div></div>
<script>
$(function () {
$().pushStack( document.getElementsByTagName("div")).remove().end();
})
</script>
定义和用法
pushStack() 函数用于将一个DOM元素集合加入到jQuery栈。
语法
用法一
pushStack( elements, name, arguments )
| 参数 | 描述 |
|---|---|
| element | Array类型 将要压入 jQuery 栈的数组元素,用于生成一个新的 jQuery 对象 |
| name | 可选。 String类型 生成数组元素的 jQuery 方法名 |
| arguments | 可选。 Array类型 传递给 Query 方法的参数(用于序列化) |
点击查看所有 jQuery 教程 文章: https://www.codercto.com/courses/l/35.html
Microformats
John Allsopp / friends of ED / March 26, 2007 / $34.99
In this book, noted web developer and long time WaSP member John Allsop teaches all you need to know about the technology: what Microformats are currently available and how to use them; the general pr......一起来看看 《Microformats》 这本书的介绍吧!