Skip to content

Instantly share code, notes, and snippets.

@carlos-sanchez
Created November 15, 2013 00:23
Show Gist options
  • Save carlos-sanchez/7476954 to your computer and use it in GitHub Desktop.
Save carlos-sanchez/7476954 to your computer and use it in GitHub Desktop.
Make entire div clickable, Here’s an easy way to make the parent div of a link clickable.
<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