<div onclick="onClose(event)">
...
</div>
function onClose(ev){
if(ev.target.attributes['class'].nodeValue=="closeicon"){
ev.target.parentNode.parentNode.removeChild(ev.target.parentNode)
}
}
<div onclick="onClose(event)">
...
</div>
function onClose(ev){
if(ev.target.attributes['class'].nodeValue=="closeicon"){
ev.target.parentNode.parentNode.removeChild(ev.target.parentNode)
}
}