Skip to content

Instantly share code, notes, and snippets.

@bspingarn
Created March 8, 2012 18:49
Show Gist options
  • Save bspingarn/2002644 to your computer and use it in GitHub Desktop.
Save bspingarn/2002644 to your computer and use it in GitHub Desktop.
Detect click outside element
$("body").click(function(e){
if(e.target.className !== "foo"){
$(".foo").hide();
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment