Reference a website loaded with JQuery - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:on

Description

Reference a website loaded with JQuery

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script> 
  <script type="text/javascript">
    window.onload=function(){/*from ww  w . ja  va  2  s .c  o  m*/
$(document).on( "click", ".myDiv", function() {
    console.log("hello");
});
    }

      </script> 
 </head> 
 <body> 
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 
  <a class="myDiv">click</a>  
 </body>
</html>

Related Tutorials