I attempted to store some text that I might use later after the </html> tag of my document (like I routinely do with \end{document} in LaTeX) but the browser still shows the text.
It was my understanding that the page is defined by what is between <html> and </html>, so why do things beyond </html> get displayed?
This is because browsers try very hard to do the right thing with malformed markup. The solution is to only create well-formed documents.
If you really want to store cruft in your document, place it in an xml/sgml comment:
<!-- this is a comment -->