SyntaxFix
Write A Post
Hire A Developer
Questions
The document.write method is very limited. You can only use it before the page has finished loading. You can't use it to update the contents of a loaded page.
What you probably want is innerHTML.