返回列表 發帖
  1. <!DOCTYPE stml>
  2. <stml>
  3.         <head>
  4.                 <meta charset="UTF-8">
  5.                 <title></title>
  6.         </head>
  7.         <body>
  8.         <script type="text/javascript">
  9.         var n = prompt("請輸入姓名:");
  10.                  hello(n);

  11.                 function hello(name)
  12.                 {
  13.                         alert(name + "hello");
  14.                 }
  15.                 var h = parseInt(prompt("請輸入身高:"));
  16.                 var w = parseInt(prompt("請輸入體重:"));
  17.                 var b = bmi(1.56,50)
  18.                 alert("你的bmi是:" + b)
  19.                 function bmi(height,weight)
  20.                 {
  21.                         return weight / (height * height)
  22.                 }
  23.         </script>
  24.         </body>
  25. </stml>
複製代碼

TOP

返回列表