1 <!DOCTYPE html> 2 <html> 3 <head lang="en"> 4 <meta charset="UTF-8"> 5 <title></title> 6 </head> 7 <body> 8 <script> 9 /**打印1-100之间所有的数字**/ 10 function printNum(){ 11 for(var i=1;i<=100;i++){ 12 console.log(i); 13 } 14 } 15 </script> 16 <button οnclick="printNum()">100</button> 17 </body> 18 </html>