I am trying to add tag via java-script on these words for trademark symbols
ABC®
ABC®/MD
Here what I tried. The following works perfectly:
<div class="content-wrapper">
ABC®/MD
</div>
$(".content-wrapper").each(function () {
$(this).html($(this).html().replace(/®\/MD/g, "<sup>®</sup>"));
}
However, I am not able to replace ® without /MD with <sup> in same content-wrapper:
<div class="content-wrapper">
ABC®/MD
</div>
$(".content-wrapper").each(function () {
$(this).html($(this).html().replace(/®?!\/MD/g, "<sup>®/MD</sup>"));
}
To sum it up, if it matches ABC®/MD then the result should be ABC<sup>®/MD</sup> and if it matches ABC® then the output should be ABC<sup>®</sup>.