代码示例:(标识:eg_js_jquery_remove_element)
<!DOCTYPE html>
<html>
<head>
<script src="/jquery/jquery.min.js"></script>
</head>
<body>

<h1>删除 HTML 元素</h1>

<h2 id="id01">Hello World!</h2>
<h2 id="id02">Hello China!</h2>

<script>
$(document).ready(function() {
  $("#id01").remove();
});
</script>

</body>
</html>
运行结果: