I have an html that has a lot of the following:
<TD CLASS="broke"> - WF-1234567 - </TD>
<TD CLASS="broke"> - WF-1111111 - </TD>
<TD CLASS="broke"> - WF-7654321 - </TD>
I want to make a javascript bookmarklet to replace all the 7-digit numbers with a hyperlink. How does one do this?
My attempt with many things wrong....
javascript:
var match=new RegExp("(- WF-....... - Review)","ig");
var x = document.getElementsByClassName("broke").innerHTML;
x=x.replace(match,<a href="www.blah.com/"+7digitSubsetofMatch>7digitlink</a>);
document.getElementsByClassName("browseItemLocation").innerHTML=x;