In this example, the .html file is small, and the JavaScript code is in a separate elastic.js file. But note that the initialization is in the .html file. Moving it to the elastic.js file causes it to stop working.
Some versions of Netscape have a peculiar bug which responds to a window resize by putting the text vertically along the left edge.