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

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

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

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.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

728 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