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
189 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now