---
title: "jquery文档删除操作remove()和empty()"
author: "小丑鱼0703"
date: "2014-04-18T15:01:06Z"
tags: []
categories: ["Web前端"]
slug: "jquery-remove-empty"
draft: false
lastmod: "2015-01-19T10:15:32Z"
id: 2048287
url: "https://wangjingyi.iteye.com/blog/2048287"
---

\[url]http://www.w3school.com.cn/jquery/jquery\_ref\_manipulation.asp\[/url] 1.empty()删除匹配的元素集合中所有的\[color=red]子节点\[/color]。 2.detach() 从 DOM 中移除匹配元素集合。 移除被选元素，包括所有文本和子节点。 保留 jQuery 对象，保留所有绑定的事件、附加的数据。 3.remove() 方法移除\[color=red]被选元素\[/color]，包括\[color=red]所有文本和子节点\[/color]。 保留 jQuery 对象可以在将来再使用这些匹配的元素， 与 detach() 不同：不保留元素的 jQuery 数据（绑定的事件、附加的数据等都会被移除）。 \[code="html"]

This is a para.

# hi,wjy

## hello world！

移除元素 \[/code]