2

Have some text that needs to be replaced, searched around this website for all results with similar titles and no luck.

Currently the text is Handling Fee: and I need it to say Shipping Insurance: - Please Help!

Here's the html output of the page;

<div class="c3 right"> 
 <h2>Order Summary</h2>
 <table class="styledtable">
 <thead>
 <tr>
 <th>Quantity</th>
 <th>Product</th>
 <th>Price</th>
 <th>Total</th>
 </tr>
 </thead>
 <tbody>
 <tr>
 <td style="text-align:center">1</td>
 <td><strong>ACT Clutch Kit - Heavy Duty (HD) (DC1-HDSS)</strong>
<div class="order_item_notes">HD Clutch Kit<br/> Performance Street Disc (SS)</div>
<div class="order_item_specs">
Components : D018, 3001532, ATCP23<br/>
</div>
 </td>
 <td style="text-align:right">314ドル.25</td>
 <td style="text-align:right">314ドル.25</td>
 </tr>
 <tr>
 <td colspan="3" style="text-align:right">Items Total</td>
 <td style="text-align:right">$<span id="itemstotal">314.25</span></td>
 </tr>
 <tr>
 <td colspan="3" style="text-align:right">Shipping:</td>
 <td style="text-align:right">$<span id="shippingtotal">TBD</span></td>
 </tr>
 <tr>
 <td colspan="3" style="text-align:right">Handling Fee:</td>
 <td style="text-align:right">$<span id="handlingfee">0.00</span></td>
 </tr>
 <tr>
 <td colspan="3" style="text-align:right">Tax:</td>
 <td style="text-align:right">$<span id="taxtotal">0.00</span></td>
 </tr>
 <tr>
 <td colspan="3" style="text-align:right">Order Total:</td>
 <td style="text-align:right">$<span id="total">0.00</span></td>
 </tr>
 </tbody> 
 </table>
 <p>Upon checkout, you <strong>must enter</strong> your cars <strong>year, make and model</strong> into the comments section at the bottom of this page.&nbsp;<strong> We will not complete your order if we do not have this information!</strong></p>
<p>&nbsp;</p>
</div>
</div> 
asked Jun 9, 2011 at 7:10

3 Answers 3

7

You can use a jQuery :contains selector:

$("td:contains('Handling Fee:')").text("Shipping Insurance:");

You can see it in action here: http://jsfiddle.net/cnhYj/

Update

in order to get it to work after the document is ready you can write it like that:

$(function() {
 $("td:contains('Handling Fee:')").text("Shipping Insurance:");
});
answered Jun 9, 2011 at 7:17
Sign up to request clarification or add additional context in comments.

1 Comment

Hi Variant, thank you for your solution however, I'm not able to get it to work. I have added the following to the header; <script type="text/javascript"> $("td:contains('Handling Fee:')").text("Shipping Insurance:"); </script> Am I approaching this properly?
0
$("td:contains('Handling Fee:').text('Shipping Insurance');
answered Jun 9, 2011 at 7:19

Comments

-1

I don't see any javascript there just html

you want to turn this.. <td colspan="3" style="text-align:right">Handling Fee:</td>

into this... <td colspan="3" style="text-align:right">Shipping Insurance:</td>

answered Jun 9, 2011 at 7:15

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.