Jquery Event Handler Example - Jquery

What is event handler and how to use it in jquery?

Snippet Code

Rate this page :
  [ 0 votes]

Event handlers are used to create dynamic web pages by using event. Event method is generally used to trigger or attach to an event handler through jquery functions. The below code is used to explain some of the event handler.

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script> <script> $(function() { $("#blurevent").blur(function(){ alert("Blur Event"); }); $("select").change(function(){ alert("Change Event"); }); $("#btn").click(function(){ alert("Click Event"); }); $("#keydown").keydown(function(){ alert("Keydown Event"); }); }); </script> <div align='center'> Enter Text : <input type='text' id='blurevent'></br></br> <select> <option>one</option> <option>Two</option> <option>Three</option> </select></br></br> <input type='button' value='Click' id='btn'></br></br> Enter Text: <input type='text' id='keydown'> </div>


Ask Questions

Ask Question