HTML:
<table>
<tr>
<td>wddsa</td>
<td>dffs</td>
</tr>
</table>
JavaScript:
$('tbody tr').each(function() {
name2 = $(this).children("td:first").text;
alert(name2);
});
Returns a bunch function and jquery code. Possibly from jquery.min. What is wrong here?
You are accessing the actual function, rather than executing it. (
.textis a function, not a variable, so you need to execute it to get its return value.text()).