runoops.com

参考手册 第167页

jQuery jQuery.escapeSelector() 方法

阅读(1480)

定义和用法 $.escapeSelector() 函数用来转义CSS选择器中有特殊意义的字符或字符串。 提示:1. 在jQuery 3.0中被添加,$.escapeSelector() 可以可靠地使用在所有jQuery支持的浏览器中。2. ...

jQuery wrapInner() 方法

阅读(865)

实例 Run this code » 在每个 <p> 元素的内容上包裹 <b> 元素: $("button").click(function(){ $("p").wrapInner(""); }); 定义和用法 wr...

jQuery wrapAll() 方法

阅读(888)

实例 Run this code » 在 <div> 元素中包裹所有 <p> 元素: $("button").click(function(){ $("p").wrapAll(""); }); 定义和用法 wrapA...

jQuery wrap() 方法

阅读(1001)

实例 Run this code » 在 <div> 元素中包裹每个 <p> 元素: $("button").click(function(){ $("p").wrap(""); }); 定义和用法 wrap() 方...

jQuery width() 方法

阅读(928)

实例 Run this code » 返回 <div> 元素的宽度: $("button").click(function(){ alert($("div").width()); }); 定义和用法 width() 方法设置或返...

jQuery val() 方法

阅读(1284)

实例 Run this code » 设置 <input> 字段的值: $("button").click(function(){ $("input:text").val("Glenn Quagmire"); }); 定义和用法...

jQuery unwrap() 方法

阅读(986)

实例 Run this code » 移除所有 <p> 元素的父元素: $("button").click(function(){ $("p").unwrap(); }); 定义和用法 unwrap() 方法移除被选元素的父元素...

jQuery toggleClass() 方法

阅读(859)

实例 Run this code » 对添加和移除所有 <p> 元素的 "main" 类进行切换: $("button").click(function(){ $("p").toggleClass("main"); }); 定义...

jQuery text() 方法

阅读(933)

实例 Run this code » 设置所有 <p> 元素的文本内容: $("button").click(function(){ $("p").text("Hello world!"); }); 定义和用法 text() 方...

jQuery scrollTop() 方法

阅读(1042)

实例 Run this code » 返回 <div> 元素的垂直滚动条位置: $("button").click(function(){ alert($("div").scrollTop()); }); 定义和用法 scrol...