I have this stuff:
<table> <tr> <td>nonono</td> <!-- FIND THIS --> </td>foobar</td> </tr> <tr> <td>nonono2</td> <!-- FIND THIS --> </td>foobar2</td> </tr> <tr> <td>nonono3</td> <!-- FIND THIS --> </td>foobar2</td> </tr> </table>
I have tried with $('td:first')
with no luck;
Expected return: <td>nonono</td>
, <td>nonon2</td>
and <td>nonon3</td>
Thanks in advance!
jQuery(". dname"). find("tr td:eq(1)"). val();
var $row = $(this). closest('table'). children('tbody'). children('tr:first').
You should use :first-child
instead of :first
:
Sounds like you're wanting to iterate through them. You can do this using .each()
.
Example:
$('td:first-child').each(function() { console.log($(this).text()); });
Result:
nonono nonono2 nonono3
Alernatively if you're not wanting to iterate:
$('td:first-child').css('background', '#000');
JSFiddle demo.
try this selector -
$("tr").find("td:first")
Demo -->
http://jsfiddle.net/66HbV/
Or
$("tr td:first-child")
Demo -->
http://jsfiddle.net/66HbV/1/
</td>foobar</td>
should be <td>foobar</td>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With