0

I'm wondering how I could replace html in javascript but I need it to work for tampermonkey, Here's some of the scripts I used

document.getElementById("id").innerHTML = "Example";

and

var element = document.getElementById("h1");
element.innerHTML = "Example"

I've tried these scripts with tampermonkey but they end up not working and I get a error, here's the error I get

ERROR: Execution of script 'New Userscript' failed! Cannot set property 'innerHTML' of null (anonymous function) @ (program):2

Can someone help me out please? it'd be appreciated :D

0 Answers0