Here's a JavaScript example of generating HTML content. This HTML page contains a short JavaScript that prints out the squares of numbers from 1 to 9. It is a “for” loop with “document.write”
View Source to see the code. Note that in the source code, the table of squares were not originally there. It is printed by the JavaScript. Save the source code and try it yourself.
Page created: 2005-05. © 2005 by Xah Lee.