Code:
<div id="wrap">
<div>Hello</div>
<H1>world</h1>
</div>
<button id='btn'>Delete</button>
I need to remove contents inside div->#wrap on button click. the result should be like
<div id="wrap">
</div>
I tried using
$("#btn").click(function(){
$( "#wrap" ).remove();
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.