To bind event to an element using jQuery is very easy task.
See the following examples,

$('#foo').bind('click', function() {
      // other stuff

You can also call external function like below,

function clickEvent()

$('#foo').bind('click', clickEvent);

Another way to bind event,


or you can write inline function like below,

Avatar for Multidots
Author : Multidots
Multidots is an enterprise WordPress digital agency and one of the WordPress VIP partner agency. The companies in performance marketing, content marketing, and content publishing in North America, Asia and Europe trust Multidots’ globally distributed team for their complex and large scale WordPress implementation and multi-platform integration.


Leave a Reply

How can we help you?

Submit your Business Enquiry here and we will get in touch shortly.

Contact Us