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"];
var regExp = new RegExp("\\b" + wordList.join("\\b|\\b") + "\\b", "g");
var $elem = $("#divWithText");
$elem.html($elem.html().replace(regExp, "$&™"));
This Regex is almost what I need. However, with a link that looks like:
<a href="/0/products/jQuery">jQuery</a>
It ends up appending the TM to the jQuery inside of the href and NOT the one between the tags.
Can anyone help out with this?
The list of words that I'll be looking for is very specific product names, and the only place they might appear inside of a tag is inside of a link like this.