Get innerHTML of a non-identified td
Hello there,
I've a small trouble I can't solve.
Here is an html table I use (I can't change the generated code):
- <table>
- <tr><th>Lastname</th><th>Country</th></tr>
- <tr id="1"><td>Doe</td><td>France</td></tr>
- <tr id="2"><td>Dummy</td><td>Russia</td></tr>
- </table>
I want to get the country of a selected row, but I don't know how.
I tried:
- $('#1').html(); // gives "Doe France"
- $('#1').text(); // gives "Doe France"
- $('#1 td').text(); //gives "Doe France"
- $('#1 td').html(); //gives "Doe"
- $('#1 td td').text(); //gives nothing
- $('#1 td td').html(); //gives nothing
So, I wonder I've to get the $('#1').html() and split to get the second element ? Or is there another way ?
Thanks by advance.
Regards