Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
132
rated 0 times [  138] [ 6]  / answers: 1 / hits: 40426  / 13 Years ago, fri, february 24, 2012, 12:00:00

I want to change the Yes! Pick me into Picked with Jquery in the following HTML structure, I used $('#myDiv>table>tr>td>table>tr').eq(1).text(Picked); But it was not working. Could someone shed some light on this please? Thanks!



FYI, the first td of the the first table itself contains another table...



 <div id=myDiv>
<table>
<tr>
<td>
<table>
<tr>
<td>Yes! Pick me!</td>

<td>Not me..</td>
</tr>

<tr>
<td>Not me..</td>
</tr>
</table>
</td>

<td>Not me..</td>
</tr>

<tr>
<td>Not me..</td>
</tr>
</table>
</div>





The section $('#myDiv>table>tr>td>table>tr>td').eq(1).text(Picked); does the trick, I forgot the last td part. Thanks to Rocket and everyone's help.


More From » html

 Answers
6

Try this:



$(#myDiv table table td:first).text(Picked)

[#87225] Thursday, February 23, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
theodore

Total Points: 318
Total Questions: 97
Total Answers: 119

Location: Turks and Caicos Islands
Member since Sun, Mar 7, 2021
3 Years ago
;