Home  >  jQuery

Example of .click() in jQuery

April 28, 2013
In jQuery, .click() is applied on an event handler. .click() triggers that event. .click() is equivalent to java script click function. We use it as
$("h6").click(function () {})
So here on click of any <h6></h6> , the given function will execute. Find the example.

<!DOCTYPE html>
h6 { color:blue; cursor:pointer;}
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<h6>Click on First Heading</h6>
<h6>Click on Second Heading</h6>
<h6>Click on Third Heading</h6>
$("h6").click(function () {


©2022 concretepage.com | Privacy Policy | Contact Us