uixpider uixpider - 3 months ago 25
CSS Question

I need to change text into woocommerfce checkout page table

I need to change content in a table th via jquery.
My pat

#post-39 > div > div > div > div.cart_totals > table > tbody > tr:nth-child(3) > th


I have tried the following code but it doesn't work.

$(document).ready(function(){
$('#post-39 > div > div > div > div.cart_totals > table > tbody > tr:nth-child(3) > th').html('foo');
});


HTML IS



$(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>&nbsp;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>&nbsp;2,407.99</span></strong> </td>
</tr>
</tbody></table>




Answer

Try this code:

$(document).ready(function(){
$('table > tbody > tr:nth-child(3) > th').html('foo');

});

check it