Javascript Ajax jQuery Html PHP Example Quiz New MORE
Need a Website Or Web Application Or Any Help.Contact Us: +91 9437911966 (Whatsapp) Note: Paid Service

jQuery click() Method

jQuery click event occurs when you click on an html element. It can be a button, span, div, hyperlink and paragraph.

It is an inbuilt function of jQuery.

jQuery click() Method Syntax
$(selector).click(function(){
//block of code that runs when the click event triggers
});

Example:

	<!DOCTYPE html>
	<html>
	<head>
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
	<script>
	$(document).ready(function(){
	  $("button").dblclick(function(){
		alert("The button was Clicked.");
	  });
	});
	</script>
	</head>
	<body>

	<button>Click on this Button.</button>
	</body>
	</html>