You would not use jQuery to replace. Instead, just use the javascript .replace() method.
(I gave the paragraph an identifier to indicate the correct paragraph.)
Try: http://jsfiddle.net/yRCjN/1/
HTML
<p id='myparagraph'>His veins burned gasoline. It kept his motor running but it never kept him clean.</p>
Javascript / jquery
// Cache the selected element so it only runs once. var $paragraph = $('#myparagraph'); // Get the text and update it with the <a> tag var newcontent = $paragraph.text().replace(/(gasoline)/,'<a href="/some/link/path">$1</a>'); // Set the new content $paragraph.html( newcontent );
Park Avenue leads to ...
source share