December 2013
Intermediate to advanced
384 pages
9h 54m
English
$("span").mouseenter(); $("#myButton").click(); $("input.bigText").trigger({'type':'keypress', 'charCode':13});
jQuery objects have methods such as click() and dblclick() that correspond to many of the event types that you can call directly. Form elements add additional methods such as blur(), focus(), keypress(), keydown(), and keyup() that can be called to trigger specific events. For example, the following statement triggers the click event for all <span> elements:
$("span").click();
jQuery also provides a way to trigger events while specifying the values of the event object using the trigger() method. There are two different syntaxes for the trigger() method, as listed ...
Read now
Unlock full access