如下:
<!DOCTYPE html> <html> <head> <title>js2.html</title> </head> <body> <script type="text/javascript"> with (document) { write("<ol>"); write("<li>hello</li>"); write("<li>world</li>"); write("<li>hello world</li>"); write("</ol>"); } </script> <br> </body> </html>
结果:
- hello
- world
- hello world