Suppressing click event from div inside div

<div id="msg_background" onclick="javascript:closemsg();"> <div onclick="event.stopPropagation();" id="new_msg_cont"></div> </div>

by Budhram Gurung

HTML

<div id="msg_background" onclick="javascript:closemsg();">
    <div onclick="event.stopPropagation();" id="new_msg_cont"></div>
</div>

CSS

#msg_background {
    background: grey;
    width: 100px;
    height: 50px;
}
#new_msg_cont {
    background: green;
    width: 25px;
    height: 25px;
}

JavaScript

function closemsg() {
    /*document.getElementById('cont').style.height = '';
    document.getElementById('cont').style.overflow = '';
    document.getElementById('cont').style.position = '';*/
    document.getElementById('msg_background').style.display = 'none';
}