> For example (I've substituted [] for <>): > [address]Location[/address] > would become > [address]Location[/address][a > href="http://maps.google.com/maps?hl=en&q=Location"]Blah Blah[/a]
This should be close: $("address").each(function(){ var $addr = $(this), loc = $addr.text().replace(/"/g,""); $addr.after('<a href="http://maps.google.com/maps?hl=en&q='+loc +'">Blah blah</a>') });