切换布局
显示结果
<html> <head> <script type = "text/javascript"> <!-- function hypotenuse(a, b) { function square(x) { return x*x; } return Math.sqrt(square(a) + square(b)); } function secondFunction() { var result; result = hypotenuse(1,2); document.write ( result ); } //--> </script> </head> <body> <p>点击以下按钮调用函数</p> <form> <input type = "button" onclick = "secondFunction()" value = "调用函数"> </form> </body> </html>