This event handler is triggered when we double click on a particular element. It is similar to the .click(), except, it is triggered on double click. Lets see a demo.
Double click to change color
To make the demo interesting , we used an array of colors and changed the value of color everytime you double click the box.
This event handler is used if you wanna track what key the user is pressing. Because of event bubbling, all key presse will make their way up to the DOM unless it is stopped. .which property of jquery specifically tells the code of the input button pressed. Lets see how.
We can get the unique code for each of the key. Hence, we can detect which key was pressed and take necessary action.
mouseenter/leave Vs mouseover/out
These events are triggered when the mouse enters and leaves the specified element on the document. mouseover/out are triggered when the mouse is over those elements. Lets see the difference between both of them.
Once we are done with selectors and event handlers , lets see some crazy jquery effects in our next chapter.