title: Detect click event inside iframe
body: <p>I'm writing a plugin for TinyMCE and have a problem with detecting click events inside an iframe. </p>
  
  <p>From my search I've come up with this:</p>
  
  <p>Loading iframe:</p>
  
  <pre><code>&lt;iframe src='resource/file.php?mode=tinymce' id='filecontainer'&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>HTML inside iframe:</p>
  
  <pre><code>&lt;input type=button id=choose_pics value='Choose'&gt;
  </code></pre>
  
  <p>jQuery:</p>
  
  <pre><code>//Detect click
  $("#filecontainer").contents().find("#choose_pic").click(function(){
      //do something      
  }); 
  </code></pre>
  
  <p>Other posts I've seen usually have a problem with different domains (this hasn't). But, still, the event isn't detected. </p>
  
  <p>Can something like this be done?</p>