jQuery Events

What is jQuery Event? An event that represents the action that perform for a specific times.

Which are the event are perform in jQuery?

  • Mouse click event
  • Mouse double click event
  • Submit a post request or form
  • Mouse hover on element
  • Some content loading on web-page where need to use by users etc.

Tip jQuery has its own ability to create interaction with Users. Events is a perform action in dynamic web-page.
We are create dynamic and responsive web page using jQuery techniques to make more easy. jQuery syntax is very simple or more powerful.

jQuery event functions

In this example, event is occurs and function is called when the click button is triggered.

$("#btn2").click(function () { 
  click action code write here...


<!DOCTYPE html>
  <title>jQuery hide() show() function</title>
  <script src="jquery-latest.min.js"></script>
    $(document).ready(function() {

      $("#btn2").click(function () {
      $("#btn1").click(function () {
    <button id="btn1">Click here to hide Paragraph</button> 
    <button id="btn2">Click here to show Paragraph</button> 
    <p style="background-color:#99FFFF;font-size:16px;font-family:Verdana;">Paragraph will hide after click</p> 

Run it...   »

Some jQuery Events Methods

Following are few frequently useful jQuery event methods

Method Description
$(document).ready(function) ready function ready to execute when document load.
$(selector).focus(function) focus function perform when focus event perform on selected element.
$(selector).blur(function) blur function perform when focus out event perform on selected element
$(selector).click(function) click function perform when click event perform on selected element
$(selector).dblclick(function) dblclick function perform when double click event perform on selected element
$(selector).mouseover(function) mouseover function perform when mouse hover event perform on selected element

Here are all jQuery event references, see all jQuery events references.