我有一個tr列,像這樣。然後,我怎麼能得到TR的id使用jQuery單擊更新ID爲「快速更新訂單產品」如何在點擊td的元素後獲得tr的id?
<tr id="product-id-<?=$product->product->id;?>">
<td><span class="product_price_show"></span></td>
<td><span><?= $product->product_qty; ?></span></td>
<td><span><?= $product->product->stock->qty; ?></span></td>
<td><span><?= $product->total_price_tax_incl; ?></span></td>
<td>
<a class="quick-update-order-product">Update</a>
</td>
</tr>
在此先感謝後.. :)
你有一個單擊處理.. 。如果是這樣結帳[.closest](http://api.jquery.com/closest) – 2015-02-24 09:35:30