December 2013
Intermediate to advanced
384 pages
9h 54m
English
$("div").on("click", "span", {name:"Brad", number:7}, function(e){ (event handler code here) }):
Events are added in jQuery using the .on(events,[,selector][,data]handler(eventObject) method. This method accepts one or more event types such as those listed in Table 6.1 as the first argument.
The optional selector value defines the descendant elements that trigger the event. Any descendant elements that match the selector also trigger the event.
The data object is anything that you want to pass to the event handler in the event.data attribute. Typically, this is either a single value or a JavaScript object. However, anything is accepted.
The handler function is the function ...
Read now
Unlock full access