jQuery Clickable Div Based on Internal Link

If you want a div to be clickable based on a standard HTML internal link, within that div, then use this jQuery snippet (requires jQuery Library):-

jQuery(document).ready(function($) {
$(".parent-div").click(function() {
window.location = $(this).find("a").attr("href");
return false;

The code will rattle through the parent div looking for links and will then add the link it to that div. Useful for components that require clickable divs with custom defined structured content (portfolio grids etc).

About the Author
jQuery Clickable Div Based on Internal Link 0da77002febbfe28d15144a57bbcc2c9 s 180 d mm r g


A highly experienced Web Designer / Web Developer (Webflow, WordPress, Weebly & Custom), Front-end / Back-end Developer & New Media Specialist, with extensive knowledge of a wide spectrum of technologies in the Development and Creative Industries, built up over a number of years.