I created a script to close my div element by clicking on the 'x' icon, but instead of deleting the div only, the whole page gets deleted. I'm not sure where I went wrong, can anyone help me?
HTML
<div class="note">
<span id='close' onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode); return false;'>x</span>
<div class="note-editable">
<p>Hello, welcome to</p>
<p1>Stickynote</p1>
<p2>Feel free to take notes</p2>
</div>
</div>