Creating Lists Dynamically

Check the use of document.close(). It closes the output stream and halts execution.
Note the icon on the tab in the browser. Comment it out and see the difference.