jQuery remove() 方法

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

实例

移除所有的 <p> 元素:

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

定义和用法

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

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

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

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

语法

$(selector).remove()

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

查看所有标签

Pragmatic Thinking and Learning

Pragmatic Thinking and Learning

Andy Hunt / The Pragmatic Bookshelf / 2008 / USD 34.95

In this title: together we'll journey together through bits of cognitive and neuroscience, learning and behavioral theory; you'll discover some surprising aspects of how our brains work; and, see how ......一起来看看 《Pragmatic Thinking and Learning》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

URL 编码/解码
URL 编码/解码

URL 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具