得到Atrribute我有如下表如何從表
<table>
<thead>
<tr>
<th col="value2"></th>
</tr>
</thead>
<tbody>
<tr id="value1">
<td></td>
</tr>
</tbody
<table>
我用下面從<tr>
"row_id": this.parentNode.getAttribute('id')
得到「值1」我試圖用下面讓山坳值從<th>
但它返回一個空值。
"colName": this.getAttribute('col')
如何正確從<th>
獲取col屬性值?
感謝您的。有沒有可能用它來指定陣列號? – Rhys