We help IT Professionals succeed at work.
Get Started

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

badwolfff
badwolfff asked
on
70 Views
Last Modified: 2015-08-30
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
Comment
Watch Question
CERTIFIED EXPERT
Top Expert 2015
Commented:
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE