To make div element as Empty use this code

Sunny.Sagar
Posted by Sunny.Sagar under jQuery category on | Points: 40 | Views : 313
<script>
$(document).ready(function(){
$("button").click(function(){
$("#div1").empty();
});
});
</script>
</head>
<body>

<div id="div1" style="height:100px;width:300px;border:1px solid black;background-color:green;">

Hi I am Pradeep.
<p>My friends call me as Sagar.</p>
<p>My pet name is Sunny.</p>

</div>
<br>

<button>Make box as Empty</button>

Comments or Responses

Login to post response