jQuery remove() 方法

jQuery 教程 · 2019-03-27 17:13:55

实例

移除所有的 <p> 元素:

$("button").click(function(){ $("p").remove(); });

定义和用法

remove() 方法移除被选元素,包括所有的文本和子节点。

该方法也会移除被选元素的数据和事件。

提示:如需移除元素,但保留数据和事件,请使用 detach() 方法代替。

提示:如只需从被选元素移除内容,请使用 empty() 方法。

语法

$(selector).remove()

点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html

查看所有标签

Mastering Bitcoin

Mastering Bitcoin

Andreas M. Antonopoulos / O'Reilly Media / 2014-12-20 / USD 34.99

Mastering Bitcoin tells you everything you need to know about joining one of the most exciting revolutions since the invention of the web: digital money. Bitcoin is the first successful digital curren......一起来看看 《Mastering Bitcoin》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具