"lblItemPrice"
单击按钮时,我需要隐藏div。我"btnEdit"
需要获取closest
具有"lblItemPrice"
类的 div。
我试过这样,但不工作。
$('.btnEdit').die('click').live('click', function () {
$(this).closest('.lblItemPrice').hide();
});
HTML
<table class="invoice" id="invoiceList">
<tbody>
<tr class="">
<td class="value" id="pricetd">
<div id="itemPriceDiv">
<div class="lblItemPrice">
$2.00
</div>
<input type="text" id="editPrice" name="editPrice" placeholder="edit price">
</div>
</td>
<td class="value">
$2.00
</td>
<td>
<button class="btnEdit actionButton secondaryButton short" type="button">
Edit</button>
</td>
<td>
</td>
</tr>
</tbody>
</table>