0% found this document useful (0 votes)
37 views4 pages

Method Description: Removed in Version 1.9

This document describes jQuery event methods and properties. It lists various event binding and triggering methods like click(), mousemove(), and hover(). It also describes event object properties that provide information about the event like event.target, event.timeStamp, and event.result. Useful code samples are provided to demonstrate getting mouse position on mousemove and accessing the return value of a previous event handler through event.result.

Uploaded by

josephine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views4 pages

Method Description: Removed in Version 1.9

This document describes jQuery event methods and properties. It lists various event binding and triggering methods like click(), mousemove(), and hover(). It also describes event object properties that provide information about the event like event.target, event.timeStamp, and event.result. Useful code samples are provided to demonstrate getting mouse position on mousemove and accessing the return value of a previous event handler through event.result.

Uploaded by

josephine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Method

Description

bind()

Attaches event handlers to elements

blur()

Attaches/Triggers the blur event

change()

Attaches/Triggers the change event

click()

Attaches/Triggers the click event

dblclick()

Attaches/Triggers the double click event

delegate()

Attaches a handler to current, or future, specified child


elements of the matching elements

die()

Removed in version 1.9. Removes all event handlers


added with the live() method

error()

Deprecated in version 1.8. Attaches/Triggers the error


event

event.currentTarget

The current DOM element within the event bubbling phase

event.data

Contains the optional data passed to an event method


when the current executing handler is bound

event.delegateTarget

Returns the element where the currently-called jQuery


event handler was attached

event.isDefaultPrevented()

Returns whether event.preventDefault() was called for the


event object

event.isImmediatePropagationStoppe
d()

Returns whether event.stopImmediatePropagation() was


called for the event object

event.isPropagationStopped()

Returns whether event.stopPropagation() was called for


the event object

event.namespace

Returns the namespace specified when the event was


triggered

event.pageX

Returns the mouse position relative to the left edge of the


document

event.pageY

Returns the mouse position relative to the top edge of the


document

event.preventDefault()

Prevents the default action of the event

event.relatedTarget

Returns which element being entered or exited on mouse


movement.

event.result

Contains the last/previous value returned by an event


handler triggered by the specified event

event.stopImmediatePropagation()

Prevents other event handlers from being called

event.stopPropagation()

Prevents the event from bubbling up the DOM tree,


preventing any parent handlers from being notified of the
event

event.target

Returns which DOM element triggered the event

event.timeStamp

Returns the number of milliseconds since January 1, 1970,


when the event is triggered

event.type

Returns which event type was triggered

event.which

Returns which keyboard key or mouse button was pressed


for the event

focus()

Attaches/Triggers the focus event

focusin()

Attaches an event handler to the focusin event

focusout()

Attaches an event handler to the focusout event

hover()

Attaches two event handlers to the hover event

keydown()

Attaches/Triggers the keydown event

keypress()

Attaches/Triggers the keypress event

keyup()

Attaches/Triggers the keyup event

live()

Removed in version 1.9. Adds one or more event handlers


to current, or future, selected elements

load()

Deprecated in version 1.8. Attaches an event handler to


the load event

mousedown()

Attaches/Triggers the mousedown event

mouseenter()

Attaches/Triggers the mouseenter event

mouseleave()

Attaches/Triggers the mouseleave event

mousemove()

Attaches/Triggers the mousemove event

mouseout()

Attaches/Triggers the mouseout event

mouseover()

Attaches/Triggers the mouseover event

mouseup()

Attaches/Triggers the mouseup event

off()

Removes event handlers attached with the on() method

on()

Attaches event handlers to elements

one()

Adds one or more event handlers to selected elements.


This handler can only be triggered once per element

$.proxy()

Takes an existing function and returns a new one with a


particular context

ready()

Specifies a function to execute when the DOM is fully


loaded

resize()

Attaches/Triggers the resize event

scroll()

Attaches/Triggers the scroll event

select()

Attaches/Triggers the select event

submit()

Attaches/Triggers the submit event

toggle()

Removed in version 1.9. Attaches two or more functions to


toggle between for the click event

trigger()

Triggers all events bound to the selected elements

triggerHandler()

Triggers all functions bound to a specified event for the


selected elements

unbind()

Removes an added event handler from selected elements

undelegate()

Removes an event handler to selected elements, now or in


the future

unload()

Deprecated in version 1.8. Attaches an event handler to


the unload event

USEFUL SCRIPTS
MOUSE POINTER POSITION
<script>
$(document).ready(function(){
$(document).mousemove(function(event){
$("span").text("X: " + event.pageX + ", Y: " + event.pageY);
});
});
</script>
EVENT RESULT-The event.result property contains the last/previous value returned by an event
handler triggered by the specified event.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
return "Hello world!";
});
$("button").click(function(event){
$("p").html(event.result);
});
});
</script>
</head>
<body>

<button>Click me to display event.result</button>


<p>This is a paragraph.</p>

</body>
</html>

You might also like