title: jQuery detect click inside a div
body: <p>I am trying to use jQuery to detect when a user clicks inside a div on a page. Should be easy enough, but it's not working.</p>
  
  <p>Here's a summary of my code (in the HTML):</p>
  
  <pre><code>&lt;div class="outerDiv"&gt;
      &lt;object id="video"&gt;
        ...
       &lt;/object&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In the jQuery:</p>
  
  <pre><code>$("body").on("click",function(e){
  if(e.target.id=="outerDiv") {
     ... do something
  }           
  if(e.target.id=="video") {
      alert("Inside div");
  }
   ...
  
  });
  </code></pre>
  
  <p>However, when clicking inside the object with the id of "video", nothing happens. But if I click inside "outerDiv", this is picked up by the code.</p>
  
  <p>Could it be beacse inside the "video" id I have an object (in this case a built in flash video player)?</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Cheers :) .</p>