Jquery – trigger body click with jQuery


I'm unable to trigger a click on the body tag using jQuery using this:


Even this fails:


Best Solution

You should have something like this:

$('body').click(function() {
   // do something here

The callback function will be called when the user clicks somewhere on the web page. You can trigger the callback programmatically with: