Skip to content

Instantly share code, notes, and snippets.

@krutz27
Created October 4, 2013 13:37
Show Gist options
  • Select an option

  • Save krutz27/6826062 to your computer and use it in GitHub Desktop.

Select an option

Save krutz27/6826062 to your computer and use it in GitHub Desktop.
//Clickable Boxes
$(document).ready(function(){
$("#clickablebox").click(function(){
window.location=$(this).find("a").attr("href");return false;
});
});
<div id="#clickablebox">
<h1><a href="#">Click Me</a><h1>
<p>This whole div will be clickable to the click you define in the above or anywhere inside the div</p>
</div>
#clickablebox {
width: 250px;
height: 250px;
margin: 150px auto;
background: #E6E6E6;
padding: 15px;
cursor: pointer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment