...

Library - JQuery

Back to Course

Lesson Description


Lession - #558 JQuery Events


JQuery events are the actions that can be detected by your web application. They are used to create dynamic web pages. An event shows the exact moment when something happens.

Syntax

 $("p">
.click (>
;
These are some examples of events.
  • A mouse click
  • An HTML form submission
  • A web web page loading
  • A keystroke at the keyboard
  • Scrolling of the web page etc.

    These events may be labeled on the basis their types:

    Mouse Events
  • click
  • dblclick
  • mouseenter
  • mouseleave
    Keyboard Events
  • keyup
  • keydown
  • keypress
    Form Events
  • submit
  • change
  • blur
  • focus
    Document/Window Events
  • load
  • unload
  • scroll

    Example
    
    
    <html>  
    <head> 
     <title>jQuery Example</title>  
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">  
     </script>  
     <script type="text/javascript" language="javascript">  
     $(document>
    .ready(function(>
    { $("p">
    .click(function(>
    { alert("This paragraph was clicked.">
    ; }>
    ; }>
    ; </script> </head> <body> <p>click here</p> </body> </html>
    Try it here