jQuery入門–empty()の使い方
コード下記
<!DOCTYPE html>
<html>
<head>
<script src="http://xxx/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$(“button").click(function(){
$(“#div_empty").empty();
});
});
</script>
</head>
<body>
<div id="div_empty" style="height:120px;width:150px;border:2px solid black;background-color:blue;">
This is some text in the div.
<p>This is a paragraph in the div.</p>
<p>This is another paragraph in the div.</p>
</div>
<br>
<button>Empty the div element</button>
</body>
</html>