Welcome to tutorial number 3 of the Easy jQuery series part of EasyProgramming.net! What is an event in programming? It's pretty much anything that happens! It can be actions that your users take or something that happen automatically (such as a timed AJAX call). jQuery makes it easy by giving you access to easy to use event methods.
Here are some examples of event handlers in jQuery:
|$(selector).blur()||Leaving a form element|
|$(selector).click()||Clicking on an element|
|$(selector).dblclick()||Double clicking on an element|
|$(selector).mouseenter()||When mouse enters over an element (e.g. canvas)|
|$(selector).mouseleave()||When mouse leaves an element|
|$(selector).ready()||When an element has been loaded, used often on the whole document itself|
|$(selector).load()||When an element/window/document has completed loading|
|$(selector).resize()||When the document screen or window is resized|
|$(selector).scroll()||When the document or window has been scrolled|
|$(selector).keydown()/.keypress()/.keyup()||Events binded to keyboard events down, press, and up|
|$(selector).hover()||mouse event hover over an element|
|$(selector).focus()||when element is focused|
|$(selector).submit()||When a form is submitted|
|$(selector).change()||When something on a form is changed|
These are just some examples! Get a complete list at https://api.jquery.com/category/events/.
To fork the fiddle and follow along: https://jsfiddle.net/easyjs/am1y3hyf/
Remember to checkout the Resources section below for associated downloadable content, JSFiddle links, and other resources. Watch the video and follow along!