+ 2
Delete a written text
i was trying to delete the text that i made using document.write("x"); but i have zero idea how
1 Antwort
+ 5
You can use innerHTML to access and change the HTML content of an element you made with document.write(). Ex:
document.getElementById("example").innerHTML = ""; //or use getElementsByClassName
However, you have to assign a (preferably unique) ID or class to what you write in document.write(), so you can access it again.