Chapter 3
More jQuery Events and Helpful Methods
Section 6
jQuery to Listen for Keyboard Events and Get Values from the Event Object
In this video, you will be using a loop to create several input fields and add them all to the main. Then, add the keydown() method to the input field, update the CSS background color, and output the event method into the console including the element index() value. Next, add the keypress() method to the input field, update the CSS background color, and output the keypress into the console including the element index() value. After that, add focus() and blur() methods to the input field, update the CSS background color, and output the event methods into the console including the element index() value. Next, add the keyup() method to the input field, update the CSS background color, and output the event method into the console including the element index() value. Finally, add focusin() and focusout() methods to the input field, which will include the children, then update the CSS background color and output the event method into the console including the element index() value.