Thanks to Chetan Sastry I have this Regex code to parse my page for a list of words and add the TM to them.
var wordList = [\"jQuery UI\", \"jQuery\", \"is\"]; v
If you are only trying to replace words within a link then the following should work:
var wordList = ["jQuery UI", "jQuery", "is"]; var regExp = new RegExp("\\b" + wordList.join("\\b|\\b") + "\\b", "g"); var $elem = $("#divWithText a"); $elem.html($elem.html().replace(regExp, "$&™"));