Jquery ReplaceWith(), loop needed

$("a").val("USD").click(function(){
$('tr:nth-child(2) > td:nth-child(6)').replaceWith('<td>&#36;6.38/month</td>');
$('tr:nth-child(3) > td:nth-child(6)').replaceWith('<td>&#36;2.08/month</td>');
$('tr:nth-child(4) > td:nth-child(6)').replaceWith('<td>&#36;4.99/month</td>');
$('tr:nth-child(5) > td:nth-child(6)').replaceWith('<td>&#36;14.95/month</td>');
$('tr:nth-child(6) > td:nth-child(6)').replaceWith('<td>&#36;2.84/month</td>');
$('tr:nth-child(7) > td:nth-child(6)').replaceWith('<td>&#36;4.99/month</td>');
$('tr:nth-child(8) > td:nth-child(6)').replaceWith('<td>&#36;12.46/month</td>');
$('tr:nth-child(9) > td:nth-child(6)').replaceWith('<td>&#36;3.95/month</td>');
$('tr:nth-child(10) > td:nth-child(6)').replaceWith('<td>&#36;4.30/month</td>');
$('tr:nth-child(11) > td:nth-child(6)').replaceWith('<td>&#36;3.96/month</td>');
});

$("a").val("GBP").click(function(){
$('tr:nth-child(2) > td:nth-child(6)').replaceWith("<td>&pound;4.08/month</td>");
$('tr:nth-child(3) > td:nth-child(6)').replaceWith("<td>&pound;1.33/month</td>");
$('tr:nth-child(4) > td:nth-child(6)').replaceWith("<td>&pound;3.19/month</td>");
$('tr:nth-child(5) > td:nth-child(6)').replaceWith("<td>&pound;9.57/month</td>");
$('tr:nth-child(6) > td:nth-child(6)').replaceWith("<td>&pound;1.82/month</td>");
$('tr:nth-child(7) > td:nth-child(6)').replaceWith("<td>&pound;3.19/month</td>");
$('tr:nth-child(8) > td:nth-child(6)').replaceWith("<td>&pound;7.98/month</td>");
$('tr:nth-child(9) > td:nth-child(6)').replaceWith("<td>&pound;2.53/month</td>");
$('tr:nth-child(10) > td:nth-child(6)').replaceWith("<td>&pound;2.75/month</td>");
$('tr:nth-child(11) > td:nth-child(6)').replaceWith("<td>&pound;2.53/month</td>");
});

Screenshot before the click event of GBP
http://snag.gy/Pp8nb.jpg
Screenshot after the click event of GBP
http://snag.gy/LKvzM.jpg

As you can see although the currency is changing as desired, once it has been changed it can not be changed back, because the jquery is finished i have tried wrapping the code in a function and then calling it just before the end and it didn’t work, any input here would be much appreciated

Hi,

Could you post a link to a page where I can see this in action?
Failing that can you post enough code so that I can reproduce this on my own PC?
I’m sure it won’t be too hard to sort out :slight_smile: