<!DOCTYPE html>
<html>
<body>
<h2>JavaScript HTML DOM</h2>
<p>子要素の削除</p>
<div id="div1">
<p id="p1">これは段落です。</p>
<p id="p2">これは別の段落です。</p>
</div>
<script>
const parent = document.getElementById("div1");
const child = document.getElementById("p1");
parent.removeChild(child);
</script>
</body>
</html>