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
var input = $("#yourInput")[0];
var div = $("#yourDiv")[0];
$(document.body).click(function(e) {
switch ( e.target ) {
case input: case div: return;
}
yourMethod();
});