【发布时间】:2017-04-04 05:07:35
【问题描述】:
我的表结构是这样的,
<table id="imagefileUploadValue">
<tbody>
<tr><td colspan="3" style="height: 25px;">
<input type="file" id="fileUploadValue" name="files[]" attrtype="attachment">
<table id="fileNameTable"></table>
</td></tr>
<tr id="deleteRow0">
<td width="20%" style="height: 25px;">test.json</td>
<td width="20%">
<img class="imageIcon" title="edit" onclick="editImage('test.json','d0adf466ab4fecf1347938fe1f','testfileUploadValue','deleteRow0','cm')">
</td>
<td><img class="imageIcon" title="delete" onclick="deleteImage('test.json','d0adf466ab4fecf1347938fe1f','deleteRowl0','cm')">
</td></tr><tr><td colspan="3" style="height: 25px;"></td></tr></tbody></table>
我正在尝试使用此代码读取该表中第一个图像标记的每个属性,
alert($('#imagefileUploadValue').closest('tr').find("img").find("class"));
alert($('#imagefileUploadValue').closest('tr').find("img").find("title"));
alert($('#imagefileUploadValue').closest('tr').find("img").find("onclick"));
alert($('#imagefileUploadValue').closest('tr').find("img").find("src"));
但我无法获得每个属性。
我在这里做错了什么。有人可以帮忙吗?
【问题讨论】:
标签: jquery html properties html-table