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
Hello World!
``` ```document.getElementById("p1").innerHTML = "New text!";``` Like here ```p1``` the ```id``` or ```h1``` should be an id. – aavrug Sep 06 '16 at 03:33