Jquery 访问元素的文本时出现问题
HTML:Jquery 访问元素的文本时出现问题,jquery,Jquery,HTML: 返回一个bunch函数和jquery代码。可能来自jquery.min。这里出了什么问题?您正在访问实际的函数,而不是执行它。(.text是一个函数,而不是一个变量,因此需要执行它来获取其返回值.text()) <table> <tr> <td>wddsa</td> <td>dffs</td> </tr> </table> $('tbody tr').each(f
返回一个bunch函数和jquery代码。可能来自jquery.min。这里出了什么问题?您正在访问实际的函数,而不是执行它。(
.text
是一个函数,而不是一个变量,因此需要执行它来获取其返回值.text()
)
<table>
<tr>
<td>wddsa</td>
<td>dffs</td>
</tr>
</table>
$('tbody tr').each(function() {
name2 = $(this).children("td:first").text;
alert(name2);
});
name2 = $(this).children("td:first").text();