I am using this code:
$('body').click(function() { $('.form_wrapper').hide(); }); $('.form_wrapper').click(function(event){ event.stopPropagation(); }); And this HTML:
<div class="form_wrapper"> <a class="agree" href="javascript:;">I Agree</a> <a class="disagree" href="javascript:;">Disagree</a> </div> The problem is that I have links inside the div and when they no longer work when clicked.
$('html')or$(document)would be better than$('body')