onclick Button delete the div code example
Example: javascript remove item onclick
function remove(elem){
elem.parentNode.removeChild(elem);
}
<div id="i", onclick="remove(this)">click</div>
function remove(elem){
elem.parentNode.removeChild(elem);
}
<div id="i", onclick="remove(this)">click</div>