I\'m trying to set conditions on a jQuery event. I have an input element and a div. I want to detect a click anywhere on the page and to execute that method but only if the clic
$('body').click(function(event){ // body click
var $target = $(event.target); // click target
if($target.is('#mydiv, #myinput')) { // click target is div or input
$target.click(); // click div or input
}
});