theocraticmind
Programmer
ok, i realy don't know how this RegExp thing works, but i've read i need to use it in the replace() function. so, this is my code, what am i doing wrong?
Code:
var strTemp
regExpBlack = new RegExp("[bg=black]", "i")
regExpRed = new RegExp("[bg=red]", "i")
regExpBlue = new RegExp("[bg=blue]", "i")
regExpGreen = new RegExp("[bg=green]", "i")
regExpOrange = new RegExp("[bg=orange]", "i")
regExpYellow = new RegExp("[bg=yellow]", "i")
strNothing = new String("")
strTemp = document.frmChange.txtContent.value
strTemp.replace(regExpBlack, strNothing)
strTemp.replace(regExpRed, strNothing)
strTemp.replace(regExpBlue, strNothing)
strTemp.replace(regExpGreen, strNothing)
strTemp.replace(regExpOrange, strNothing)
strTemp.replace(regExpYellow, strNothing)
document.frmChange.txtContent.value = strTemp