<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript"> var sum=prompt('请输入要输出的次数') sum=parseInt(sum) for(var i=0;i<sum;i++) { document.write('hello world <br/>') } </script> </head> <body> </body> </html>