<!DOCTYPE html>
<html>
<body>
<h2>JavaScript HTML DOM</h2>
<h3>HTML要素を削除します。</h3>
<div>
<p id="p1">これは段落です。</p>
<p id="p2">これは別の段落です。</p>
</div>
<button onclick="myFunction()">要素の削除</button>
<script>
function myFunction() {
document.getElementById("p1").remove();
}
</script>
</body>
</html>