jqueryを使用してテーブルのコンテンツを変更する必要があります。 私のパットテキストをwoocommerfceチェックアウトページテーブルに変更する必要があります
#post-39 > div > div > div > div.cart_totals > table > tbody > tr:nth-child(3) > th
私は、次のコードを試してみましたが、それは動作しません。
$(document).ready(function(){
$('#post-39 > div > div > div > div.cart_totals > table > tbody > tr:nth-child(3) > th').html('foo');
});
HTMLは、このコードを試し
$(document).ready(function(){
$('table > tbody > tr:nth-child(3) > td').html('foo');
});
<table cellspacing="0" class="shop_table shop_table_responsive">
<tbody><tr class="cart-subtotal">
<th>Subtotal</th>
<td data-title="Subtotal"><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span> 2,370.00</span></td>
</tr>
<tr class="shipping">
<th>Shipping</th>
<td data-title="Shipping">
</td>
</tr>
<tr class="shipping">
<th>Shipping 2</th>
<td data-title="Shipping 2">
</td>
</tr>
<tr class="order-total">
<th>Total</th>
<td data-title="Total"><strong><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span> 2,407.99</span></strong> </td>
</tr>
</tbody></table>
は、私はそれが '何の兄はその目 –
これはwoocommerceチェックアウトページ、私が変更されていないされていない'任意のHTML td'だと思います。彼らはこれをこのように使用しました – uixpider
主に' th'は、テーブルのヘッダー –