我有以下问题;
下面是我的表格示例;
<table id="clientDetails">
<tbody>
<tr>
<td>Client - Mr Smith</td>
</tr>
<tr>
<td>Client - Mr Ted</td>
</tr>
<tr>
<td>Client - Mr Dhillon</td>
</tr>
<tr>
<td>Client - Mr Sean</td>
</tr>
<tr>
<td>Client - Mr Hart</td>
</tr>
</tbody>
我想要工作的 Jquery 是;
$(function test() {
var elTableRow = document.getElementById("clientDetails");
var elTableCells = elTableRow.getElementsByTagName("td");
var test = alert(elTableCells[1].innerText);
$('body').append(test);
}
)