$remove
Remove element from DOM.
$remove( element )
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_remove()">Remove box 2</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_remove()
{
$remove( $("box2") );
}
Demonstration
box 1
box 2
box 3