Jquery Ready Example - Jquery

How to execute a function when the DOM is fully loaded in jquery?

Snippet Code


  
Rate this page :
  [ 0 votes]

The ready event is executed when the document object model has been loaded. When the ready event occurs it is specified through ready method. Use ready() method to make a function after the document is loaded.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script type='text/javascript'> $(document).ready(function() { $("#keydown").keydown(function(){ alert("Keydown Event"); }); }); </script> <div align='center'> <b>Enter Text :</b> <input type='text' id='keydown'> </div>

Tags


Ask Questions

Ask Question