Example that works: $(document).ready(function(){ $('.clic').click(function(){ var s = '#b'+$(this).text().replace(/\./g,'\\.'); $(s).text(s); }); });
<div class='clic'>LX.E620Y.002</div> <div id='bLX.E620Y.002'></div> On Nov 29, 9:09 pm, jonnybravo <[EMAIL PROTECTED]> wrote: > ps heres the important parts of the pastebin for your convenience: > > function addCart(code,session){ > $("#b\\[code\\]\\").html('<div style="text-align: center; display: > block;"><img src="admin/images/g2/loadingg.gif"></div>'); > $.post("index.php?p=viewCart&add="+code, > > function(data){ > $('#cartbox').fadeOut( 'normal', function() { > > $(this).load('includes/check_sum.box.php?jq=1').fadeIn('normal'); > $("#b\\[code\\]\\").html('<div style="text-align: center; > display: > block; font-weight: bold;"><img src="admin/images/g2/check.gif"> Added! > </div>'); > }); > > }) > return false; > } > > <td id='bLX\\.E620Y\\.002' class='small'> > > <a class='buyButton' onclick="addCart('LX\\.E620Y\\.002'); return > false;" > href='index.php?p=viewCart&add=LX.E620Y.002'> > <img src='admin/images/g2/add_to_cart.gif' alt='Add to Cart'></a>