Avatar of badwolfff
badwolfff
Flag 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="http://temp.novelbread.com/informazioni/nutrienti-del-germe/" 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="http://temp.novelbread.com/immagini/image-for-vitaminsminerals.jpg" class="zoom"><i class="icon-search"></i></a><a href="http://temp.novelbread.com/informazioni/nutrienti-del-germe/" class="link"><i class="icon-link"></i></a></div></div><div class="image-wrapper scale-with-grid"><a href="http://temp.novelbread.com/informazioni/nutrienti-del-germe/" class="link"><img width="1000" height="577" itemprop="image" alt="image-for-vitaminsminerals" class="scale-with-grid wp-post-image" src="http://temp.novelbread.com/immagini/image-for-vitaminsminerals.jpg"></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: http://temp.novelbread.com/informazioni/nutrienti-del-germe/

thanks in advance
jQueryJavaScriptHTML

Avatar of undefined
Last Comment
Tom Beck

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Tom Beck

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes