How do you make a div tag into a link. I would like my entire div to be clickable.
JS:
<div onclick="location.href='url'">content</div>
jQuery:
$("div").click(function(){ window.location=$(this).find("a").attr("href"); return false; });
Make sure to use cursor:pointer for these DIVs
cursor:pointer
2.1m questions
2.1m answers
60 comments
57.0k users