title: Jquery Bind click event to elements in child window
body: <p>I have code that will create a child window and inside this window I want to be able to fire an alert whenever a user clicks on one of the defined html elements. The code will work as I want it to on the main window, but when I apply it to the child window it doesn't work.</p>
  
  <p>When the method below runs it will output "Window loaded" to the console window, but it doesn't ever launch the click event. </p>
  
  <pre><code>function OpenUrl()
  {
      var url = $("#urltoopen").val();
      var childwindow = window.open(url, '', 'width=800, height=500');
      childwindow.focus();
      $(document, childwindow.document).ready(function(){
          console.log("Window loaded");
          $( "div, span, li, ul, ol, input, button", childwindow).click(function(e) {
              console.log("Child click event");
              e.preventDefault();
              e.stopPropagation();
              alert("element clicked");
          });
      }); 
  }   
  </code></pre>