Link to home
Start Free TrialLog in
Avatar of badwolfff
badwolfffFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How do I use jQuery to set a get url for one element based on its child element?

This is my HTML code:
<div class="masonry-hover-wrapper"><div class="hover-desc"><div class="desc-inner"><h3 itemprop="headline" class="entry-title"><a href="" class="link">Nutrienti del germe</a></h3><div class="desc-wrappper">Welcome to WordPress. This is your first post. Edit or delete it, then start writing! Welcome to WordPress. This is your first post. Edit or delete […]</div></div><div class="links-wrappper clearfix"><a rel="prettyphoto" href="" class="zoom"><i class="icon-search"></i></a><a href="" class="link"><i class="icon-link"></i></a></div></div><div class="image-wrapper scale-with-grid"><a href="" class="link"><img width="1000" height="577" itemprop="image" alt="image-for-vitaminsminerals" class="scale-with-grid wp-post-image" src=""></a></div></div>

Open in new window

I need to be able to click anywhere inside the div (so basically I need to activate a click function on div.masonry-hover-wrapper which should take me to the same url as the link in the child a tag:

thanks in advance
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial