![]() |
VOOZH | about |
jQueryclick() is an inbuilt method that starts the click event or attaches a function to run when a click event occurs.
$(selector).click(function);It accepts an optional parameter "function" which is used to run when a click event occurs.
jQuery examples to show the working of click() method:
Example 1: In the below code, no function is passed to this method.
Output:
👁 ImageExample 2: In the below code, the function is passed to this method.
Output:
👁 Image