循环产生 HTML 标题

  1. <html>
  2. <body>
  3.  
  4. <script type="text/javascript">
  5. for (i = 1; i <= 6; i++)
  6. {
  7. document.write("<h" + i + ">这是标题 " + i)
  8. document.write("</h" + i + ">")
  9. }
  10. </script>
  11.  
  12. </body>
  13. </html>