/ Published in: jQuery

I had a load of divs with 1 link in and I wanted the div to be act as the link.
(add cursor:pointer to the parent Divs css so peeps know they can click it)
(add cursor:pointer to the parent Divs css so peeps know they can click it)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$('.parentElement').bind('click', function() { // Change window.location (Address) to the url from this element inside it window.location = $(this).find('.linkClass').attr('href'); });
Comments
