How to add an element after the opening body tag on an empty HTML page?

yes - you can use the hundreds of different document object model commands that make up a significant fraction of the commands available in JavaScript.