Solved

How do I use jQuery to make sure all elements contained within a certain element (identified by class) become clickable and inherit the href url from a nested a tag?

Posted on 2015-01-14
1
198 Views
Last Modified: 2015-01-14
How do I use jQuery to make sure all elements contained within a certain element (identified by class) become clickable and inherit the href url from a nested a tag?

Please visit this page:
http://www.clarktogei.jp/%E3%81%94%E6%8C%A8%E6%8B%B6/

At the bottom of the page you will see three icons (pointing to other blog items). They are divs with class .item

Inside each there is an a href link.
I would like to be able to click any element within div.item (including div.item) and be able to go to the href of the nested a tag.

Please help

thanks in advance
0
Comment
Question by:badwolfff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 40549245
Hi,
you might try the jQuery code from this sample:
http://jsfiddle.net/EE_RainerJ/znh39ayt/

I used your classes - so copy&paste and replacing the alert with the window.location = targetUrl should hopefully work.
HTH
Rainer
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question