jQuery Events


jQuery Events represents the happenings in the page.


jQuery Event Types with Example

  • Button click
  • Mouseover
  • Scrolling page
  • Selecting check box
  • Double click
  • Keypress

jQuery Events with click example


jQuery Events – click() example


<script type="text/javascript">
         $(document).ready(function(){
         $("#demo").click(function(){
           $(this).css("background","yellow");
           alert("You Clicked Me!");     
          });
          });
</script>    

Try it »

jQuery Event with double click example

jQuery Events – dblclick() example


<script type="text/javascript">
         $(document).ready(function(){
         $("#demo").dblclick(function(){
           $(this).css("background","yellow");
           alert("Double Click Event occurred.");     
          });
          });
</script>    

Try it »


jQuery Event with mouseover() example


jQuery Events – Mouseover example


<script type="text/javascript">
         $(document).ready(function(){
         $("#demo").mouseover(function(){
           $(this).css("background","yellow");
           alert("This is Mouse over event!");     
          });
          });
</script>    

Try it »


jQuery Event with blur() example


jQuery Events – blur example


<script type="text/javascript">
         $(document).ready(function(){
         $("#demo").blur(function(){
           $(this).css("background","yellow");
           alert("Blur event occurred!");     
          });
          });
</script>    

Try it »


Advertisements

Add Comment

📖 Read More