<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Math </title>
<script type="text/javascript">
var mynum = Math.random()*10);
document.write(Math.round(mynum));
</script>
</head>
<body>
</body>
</html>
Mathvar mynum = Math.random()*10);把这行最后那个)去掉试试