Event Handling Functions using jQuery

Event handling are the important function in jQuery. Event handlers are called when something happens eg: clicking a button. It is referred as trigger of an event.

Let us describe with simple example:

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
<button>Click me to hide</button>


By clicking (triggering) a button i.e; $(“button”).clicking (function(){*** some statements***}) it will hide the all details inside the paragraph i.e;  $(“p”).hide();

Some jQuery Event Functions:

$(document).ready(function) -Triggers the function on ready event of the document

$( selector).click(function) –  Triggers the function on click

$(selector).dblclick(function) – Triggers the function on double click

$(selector).hide(function) – Triggers the function to hide the selected items

$(selector).toggle(function) – Triggers the function on toggle

Posted in jQuery Tagged with: