I have HTML like this — BLAH BLAH BLAH <sup>x</sup> — inside a <th>.
I am trying to replace <sup>x</sup> by (x).
These are all the different methods I have tried. insideSup is the letter.
newText = $(tableRow).find("th").eq(tdIndex)
.text().replace("<sup>(.*?)</sup>", " ") + "(" + insideSup + ")";
newText = $(tableRow).find("th").eq(tdIndex)
.html().replace("<sup>(.*?)</sup>", " ") + "(" + insideSup + ")";
newText = $(tableRow).find("th").eq(tdIndex)
.find("sup").html().replace("/<sup>/g", " ") + "(" + insideSup + ")";
newText = $(tableRow).find("th").eq(tdIndex)
.find("sup").html().replace("<sup>(.*?)</sup>", " ") + "(" + insideSup + ")";
newText = $(tableRow).find("th").eq(tdIndex)
.text().find("sup").html().replace("<sup>(.*?)</sup>", " ") + "(" + insideSup + ")";