Skip to content

Instantly share code, notes, and snippets.

@dyaa
Created September 9, 2013 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dyaa/6501677 to your computer and use it in GitHub Desktop.
Save dyaa/6501677 to your computer and use it in GitHub Desktop.
Make Entire Div Clickable Looks for a link inside div with class of "myBox". Redirects to that links value when anywhere in div is clicked.
<div class="myBox">
blah blah blah.
<a href="http://google.com">link</a>
</div>
$(".myBox").click(function(){
window.location=$(this).find("a").attr("href");
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment