JavaScript
Article
By Sam Deering

Make Entire Div Clickable

By Sam Deering

Simple jQuery code snippet to make a div element into a hyperlink so that the user can click anywhere inside and be directed to the link href.

$(".myBox").click(function(){
     window.location=$(this).find("a").attr("href");
     return false;
});
Recommended
Sponsors
Get the latest in JavaScript, once a week, for free.