jcadima
2/28/2017 - 2:46 PM

Make Entire Div Clickable

Make Entire Div Clickable

https://css-tricks.com/snippets/jquery/make-entire-div-clickable/

http://stackoverflow.com/questions/13452398/jquery-how-to-make-a-clickable-div-open-in-a-new-window

MAKE CURSOR POINTER VISIBLE
<style>
.myBox:hover { 
  cursor: pointer; 
}
</style>

<div class="myBox">
  blah blah blah.
  <a href="http://google.com">link</a>
</div>



<script>
// opens on the same page
jQuery(".myBox").click(function() {
  window.location = jQuery(this).find("a").attr("href"); 
  return false;
});  
  
  
// Opens in a new tab
  
jQuery(".myBox").click(function() {
    window.open(jQuery(this).find("a").attr("href"), '_blank');
  return false;
});  

</script>