I'm using this line to change a specific word in a text to other word:
document.body.innerHTML = document.body.innerHTML.replace(/katt/g, "smurf");
Now I'm trying to use the same line to change an image URL in HTML but it doesn't work. I trying this code:
document.body.innerHTML = document.body.innerHTML.replace(/"https://oldimage.jpg"/g, "https://newimage.jpg");