我有一個表,我試圖替換文本中應該是文件名td的兄弟,但它似乎並沒有工作。jQuery選擇器沒有替換文字
這裏就是我想:
var current = $(".filename:contains('image.jpg')").siblings();
current.find(".filesize").text('new text');
的HTML:
<table id="uploadifive-fileupload-queue" class="table table-striped uploadifive-queue">
<tbody>
<tr class="uploadifive-queue-item complete" id="uploadifive-fileupload-file-0">
<td class="preview">thumb</td>
<td class="filename">image.jpg</td>
<td class="filesize">100x100</td>
<td class="fileinfo">Failed</td>
<td class="fileactions">Create Thumbnail</td>
<td class="filedelete"><button class="btn btn-danger">Delete</button></td>
<tr>
</tbody>
</table>
您正在尋找兄弟姐妹的孩子沒有兄弟姐妹自己。要搜索兄弟姐妹,請在兄弟功能中使用選擇器。 – 2012-07-12 19:32:00