Started

Selectors

Utilities

Animation

AJAX

CSS

Event

Manipulation

Cookie

String

Attributes

Data

Storage

Miscellaneous

$empty

Clear up all content or child nodes from target element.
$empty( element )
  1. element [object]
    The target element.

Notes

Common function to update content on the page.

Example

HTML code
<div id="box_wrap">
<div id="box1" class="box_item">box 1</div>
<div id="box2" class="box_item">box 2</div>
<div id="box3" class="box_item">box 3</div>
</div>
<button onclick="start_empty()">Empty box_wrap</button>
CSS code
#box_wrap {
	width: 300px;
	font-size: 12px;
	background: #eee;
	border: 4px solid #333;
	padding: 10px;
}

.box_item {
	width: 100px;
	height: 50px;
	font-size: 12px;
	background: #5599bb;
	padding: 10px;
	margin: 10px 0;
}
JavaScript code
function start_empty()
{
	$empty($("box_wrap"));
}
Demonstration
box 1
box 2
box 3