<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Math </title> <script type="text/javascript"> var c var x function y() { c=Math.random()*10 x=Math.round(c)); document.getElementById("result").value=x } </script> </head> <body> <input type=button value="重置" onclick="y()" /><br/> 随机值四舍五入结果为<input type=text id="result"> </body> </html>
火丁啊