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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
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…

828 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