| Event | Format | Example | Description |
|---|
ready | $(document).ready(function) | $(document).ready(function() { $("#txtFirst").blur(function () { $("#txtFirst").css("background-color", "#D6D6FF"); }); }); | Occurs when the DOM has loaded, and the page has been completely rendered (including images). |
|---|
blur | $(selector).blur(function) | see above blur function | Specifies the function to run when the selected element or elements loose focus. |
|---|
| change | $(selector).change(function) | $("#txtLastName").change( function(){ $("txtLastName").css("background-color", "#D6D6FF").}); }); | The change event occurs when the value of text fields, text areas and select elements change. The jQuery change() function specifies what happens when the control change event occurs. |
|---|
| click | $(selector).click(function) | $("#btnChange").click( function(){ $("txtLastName").css("background-color", "#D6D6FF").}); }); | Binds a function to the selected element or elements that can have a click event. |
|---|
| dblclick | $(selector).dblclick(function) | $("#iconLink").dblclick(function(){ $("#para1").hide(); }); | Binds a function to the selected element or elements that can have a double-click event. |
|---|
| focus | $(selector).focus(function) | $("#txtFirst").focus(function () { $("#txtFirst").css("background-color", "#FF3333"); }); | The focus event occurs when an element is selected by a mouse click or by tabbing to it. The jQuery focus() triggers an element focus event without a parameter, or with a function parameter, it specifies what occurs when a focus event happens. |
|---|
| keypress | $(selector).keypress(function) | $("#txtName").keypress(function () { alert("keypress happened"); }); | This jQuery event occurs when an element with focus is left mouse clicked and depressed. Like the keydown event, the keypress event occurs for each inserted character. The keypress method also triggers the blur event above, or if the function parameter is set, it specifies what occurs when a keypress event happens. |
|---|
| keydown | $(selector).keydown(function) | $("#txtKeydown").keydown(function () { alert("keydown happened"); }); | This jQuery event occurs when an element with focus has a key depressed. Like the keypress event, the keydown event occurs for each inserted character. If the function parameter is set, it specifies what occurs when a keydown event happens. If the keydown event is set on the DOM, this event will occur on any page element. |
|---|
| keyup | $(selector).keyup(function) | $("#txtKeyup").keyup(function () { alert("keyup happened"); }); | This jQuery event occurs when an element with focus has a key released. Like the keypress event, the keyup event occurs for each inserted character. If the function parameter is set, it specifies what occurs when a keyup event happens. If the keyup event is set on the DOM, this event will occur on any page element. |
|---|
| mousedown | $(selector).mousedown(function) | $("#txtmousedown").mousedown(function () { alert("mousedown happened"); }); | This jQuery event occurs when an element with focus has a mouse pointer over it and the mouse left click is performed. If the function parameter is set, it specifies what occurs when a mousedown event happens. |
|---|
| mouseover | $(selector).mouseover(function) | $("#txtmouseover").mouseover(function () { alert("mouseover happened"); }); | This jQuery event occurs when an element has a mouse pointer over it. If the function parameter is set, it specifies what occurs when a mouseover event happens. |
|---|
| mouseleave | $(selector).mouseleave(function) | $("#txtmouseleave").mouseleave(function () { alert("mouseleave happened"); }); | This jQuery event occurs when an element has a mouse pointer leaves it. If the function parameter is set, it specifies what occurs when a mouseleave event happens. |
|---|
| mouseenter | $(selector).mouseenter(function) | $("#txtmouseenter").mouseenter(function () { alert("mouseenter happened"); }); | This jQuery event occurs when an element has a mouse pointer enters it. If the function parameter is set, it specifies what occurs when a mouseenters event happens. |
|---|
| select | $(selector).select(function) | $("#txtselect").select(function () { alert("selecthappened"); }); | This jQuery event occurs when an element occurs when the text is selected (highlighted) in a text area or text input element.If the function parameter is set, it specifies what occurs when a select event happens. |
|---|
| submit | $("form").submit(function(e){ alert("Form Submit Event Occurred"); }); | | |
|---|
| | | |
|---|