Jquery Ready Function Example - Jquery

How to use ready function in jquery?

Snippet Code


  
Rate this page :
  [ 0 votes]

Jquery ready function will execute after the document is loaded completely. Adding the jquery can help to prevent the conflicts with other javascript frameworks. The sample code for ready function is given below.

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script> <script> jQuery(document).ready(function($) { $("#keydown").keydown(function(){ alert("Keydown event is called here!!"); }); }); </script> <div align='center'> Enter Text: <input type='text' id='keydown'> </div>

Tags


Ask Questions

Ask Question