For my HTML website, I am trying to replace one string with another using JavaScript. Specifically, within the nodeList "AuthorList," there is a string called "Test String" that needs to be changed to "new test."
I have attempted various modifications of the code below without success and keep encountering errors.
for(var i=0, num=AuthorList.length; i<num; i++){
if(AuthorList[i] = "Test String")
{
string.replace("New Test")
}
}
In addition to replacing the text, I also need to apply styles to the new string. Is there a method to accomplish this while simultaneously changing the text?