JavaScript - - By Sam Deering

Make Entire Div Clickable

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;
});
Sponsors
Login or Create Account to Comment
Login Create Account