SyntaxFix
Write A Post
Hire A Developer
Questions
document.body is not yet available when your code runs.
document.body
What you can do instead:
var docBody=document.getElementsByTagName("body")[0]; docBody.appendChild(mySpan);