accessing div inside the td using jquery
Posted
by azamsharp
on Stack Overflow
See other posts from Stack Overflow
or by azamsharp
Published on 2010-03-18T19:44:52Z
Indexed on
2010/03/18
19:51 UTC
Read the original article
Hit count: 173
jQuery
not sure why I find this so difficult. Here is the html code:
<tr>
<td>FirstName 9</td><td>LastName 9</td><td>
<a href="#" id="linkSponsorMessage">View</a>
</td><td>
<div class="divSponsorMessage" style="display:none">
Greetings FirstName 9, LastName 9!
</div>
</td>
</tr>
I need to access the when click on the anchor link using JQuery.
UPDATE:
I got to work:
$("#linkSponsorMessage").parent("td").next("td").children("div")
But is there a better way!!!
© Stack Overflow or respective owner