title: How to make the js function "onClick" work only on the container div?
body: <p>I got a problem with the onClick function. I have to set  </p>
  
  <pre><code>display: none;
  </code></pre>
  
  <p>in a css container div when the user clicks on it, but not when he clicks on the divs which are in the container.</p>
  
  <pre><code>&lt;div id="msg_background" onclick="javascript:closemsg();"&gt;
      &lt;div id="new_msg_cont"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So, i don't want that clicking on "new_msg_cont" the function still works.</p>
  
  <p>Here's the js:</p>
  
  <pre><code>function closemsg() {
      document.getElementById('cont').style.height='';
      document.getElementById('cont').style.overflow='';
      document.getElementById('cont').style.position='';
      document.getElementById('msg_background').style.display='none';
  }
  </code></pre>
  
  <p>Thanks in advance.</p>