jQuery Tutorial


jQuery Example


jQuery References


jQuery click() Event Reference


  jQuery Events References


Uses

click() Event occurs when the mouse click.


Bind a Function to click() event

Defined specific function run when the click event occurs on the selected elements.

Syntax

$(selector).click(function) 

jQuery click() events supported following parameters.

ParameterDescription
functionFunction is Optional parameter. Function define the ready to run when event occur.

Example

<script type="text/javascript"> 
$(document).ready(function(){
  $("input").click(function(){
    $(this).css("background-color","pink");
  });
});
</script>
Online Try This Code Your Self....   »

Trigger the click() event

Triggering the click event for a selected elements.

Syntax

$(selector).click() 

Example

<script type="text/javascript"> 
$(document).ready(function(){
  $("input").click(function(){
    $(this).css("background-color","pink");
  });
  $("button").click(function(){
    $("input").click();
  });  
});
</script>
Online Try This Code Your Self....   »

  jQuery Events References