Run code when document is ready - Javascript jQuery

Javascript examples for jQuery:Document

Description

Run code when document is ready

Demo Code

ResultView the demo in separate window

<html>
   <head></head>
   <body> 
      <h1>Hello World!</h1>  
      <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> 
      <script>
     window.jQuery = window.$ = jQuery;/*from ww  w  .  j a  v a 2  s. c om*/
     $(document).ready(function() {
         console.log( "jQuery is loaded" );
     });
  
      </script> 
   </body>
</html>

Related Tutorials