我使用jquery动态构建了一个表。在我的代码下面:
<div class="scroll-pane">
<table class="table support-table">
<thead>
<th id="support-field-1"></th>
<th id="support-field-3"></th>
<th id="support-field-4"></th>
<th id="support-field-5"></th>
<th id="support-field-6"></th>
</thead>
<tbody>
</tbody>
</table>
</div>
<script>
var container = $('.support-table tbody');
var ticket;
var j;
for(var i = 0; i < support.length; i++) {
var id=support[i].identification!=null ? support[i].identification : '';
var sdateTime = support[i].sdateTime!=null ? support[i].sdateTime : '';
var type = support[i].type!=null ? support[i].type : '';
var subtype = support[i].subtype!=null ? support[i].subtype : '';
var status = support[i].status!=null ? support[i].status : '';
var feedback = support[i].feedback!=null ? support[i].feedback : '';
ticket = '<tr class="ticketRow" id="ticket'+i+'"><td>'+sdateTime+'</td>';
ticket += '<td>'+type+'</td><td>'+subtype+'</td><td>'+status+'</td> <td>'+feedback+'</td></tr>';
container.append(ticket);
}
</script>
我根据JSON对象的长度动态构建了表,并且#34;支持。&#34; 现在我想更改表格第三行中的子类型文本。我怎么能用jquery做到这一点?我正在尝试:
$('table support-table').children('tbody').children('tr').eq(3).eq(4).html("POSITIVE");
但我没有成功。我做错了什么?