This message appears Uncaught DOMException: Failed to execute 'append' on 'Document': Nodes of type '#text' may not be inserted inside nodes of type '#document'.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
write()
will do what you described as noted at the top of the documentation for the method which is found here: developer.mozilla.org/en-US/docs/W..."[C]alling document.write on a closed (loaded) document automatically calls document.open, which will clear the document."
I'm also curious to know what it is you are trying to do. Maybe append() is what you're looking for.
This message appears
Uncaught DOMException: Failed to execute 'append' on 'Document': Nodes of type '#text' may not be inserted inside nodes of type '#document'.