I would like to open email-signup when I click on email-signup-link. Then I would like to close it by clicking anywhere on the page except for the
email-signup
email-signup-link
$(":not(#email-signup)").click(function() { $("#email-signup").hide(); });
Although you'd be better off having some kind of an overlay behind the popup and binding the above click event to that only.