AddEventListener to iFrame to add mouse up listener - Javascript jQuery

Javascript examples for jQuery:iframe

Description

AddEventListener to iFrame to add mouse up listener

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.js"></script> 
  <script type="text/javascript">
        $(window).load(function () {
            var $frame = $("#myIFrame");
            $frame.contents().bind("mouseup", function (e) {
                console.log('inside');
            });/*  w w  w .j  a v  a 2  s .co m*/
        });
    
      </script> 
 </head> 
 <body> 
  <iframe id="myIFrame" src="http://your server" style="position:absolute; width:500px; height:500px;left:0px; top:50px"></iframe>  
 </body>
</html>

Related Tutorials