Return to Snippet

Revision: 31340
at September 3, 2010 02:16 by reynish

Initial Code
$('.parentElement').bind('click', function() {
  // Change window.location (Address) to the url from this element inside it
  window.location = $(this).find('.linkClass').attr('href');

Initial URL

Initial Description
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)

Initial Title
Make parent DIV a clickable link using href from a child anchor

Initial Tags

Initial Language