so I've been trying to learn some javascript and have been working on a very (very) basic userscript that simply changes the text color of a link on a site (not a site I control the source for). Problem is, when the script is run, it changes the link text color, and the link still works, but a few functional elements nearby just stop working entirely (search bar preview, search button, profile dropdown list). My script body is nothing more than:
document.body.innerHTML= document.body.innerHTML.replace(/Advanced\n\s{1,}Search/,"\<span style\=\"color\: \#2898FF\"\> Advanced Search \<\/span\>");
I've also tried running the script as a bookmarklet for in case there's anything wrong with how the userscript is run/the metadata associated with it, but nope, same situation. Would truly appreciate some help ^^