jQuery Event Methods Overview With Example

jQuery API provides different event methods to interact with the browser. jQuery event method registers an event handler when the user interacts with the web pages. We can make any manipulations on the selected element after registering the event handler. This makes the web page more dynamic.

jQuery events functions are huge and can get triggered by any type of mouse movement or clicks, keyboard activities, hover, focus etc.

These are the various jQuery event methods provided by the API:

  1. .click(): This method fires on a mouse click.
  2. .dblclick(): This method fires on a mouse double-click.
  3. .mousedown(): This method fires when mouse button is pressed.
  4. .mouseenter(): This method fires when the mouse enters the html element area.
  5. .mouseleave(): This method fires when the mouse leaves the html element area.
  6. .mousemove(): This method fires when the mouse is moved.
  7. .mouseout(): This method fires when the mouse moves out of the html element.
  8. .mouseover(): This method fires when the mouse moves over the html element.
  9. .mouseup(): This method fires when the mouse button is released
  10. .hover(): This method fires when the mouse enters and leaves the html elements.
  11. .keydown(): This method fires when a key is pressed
  12. .keypress(): This method fires when a key is pressed and released.
  13. .keyup(): This method fires when a key is released.
  14. .blur(): This method fires when the html element loses focus.
  15. .change(): This method fires on change.
  16. .focus(): This method fires when an element gets focus.
  17. .load(): This method fires when a document is loaded
  18. .unload(): This method fires when documents are unloaded
  19. .error(): This method fires when there is an error.
  20. .resize(): This method fires when the window is resized.
  21. . scroll (): This method fires when the window is scrolled.
  22. . select (): This method fires when a text is selected.
  23. .submit(): This method fires when a form is submitted.

The general syntax for using jQuery event method is selector.jQueryEventMethod(). jQueryEventMethod could be any above mentioned methods. You can use these methods in your code to effectively interact with the browser. We will look into these jQuery events with examples in coming posts.

By admin

Leave a Reply

%d bloggers like this: