December 2013
Intermediate to advanced
384 pages
9h 54m
English
function myHandler(e){ //get the value of the object that triggered the event var originalValue = $(e.target).val(); //get the value of the current object var currentValue = $(e.currentTarget).val(); //get the inner HTML of the current object var currentHTML = $(this).html(); }
The event object provides a link to the DOM object that originally triggered the event as the event .target attribute. The event object also provides a link to the DOM object that triggered the current event handler as the event.currentTarget attribute. Having access to these objects is useful because it allows you to obtain additional information, such as checked state or value.
The object ...
Read now
Unlock full access