慕慕8881611
2017-09-12 19:00
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Math </title>
<script type="text/javascript">
var ran=Math.random()*10;
document.write(ran.round());
</script>
</head>
<body>
</body>
</html>
大功告成、!
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Math </title>
<script type="text/javascript">
document.write(Math.round(parseInt(Math.random()*10)));
</script>
</head>
<body>
</body>
</html>
这样也不行呀、
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Math </title>
<script type="text/javascript">
document.write((Math.random()*10).round());
</script>
</head>
<body>
</body>
</html>
JavaScript进阶篇
468061 学习 · 21891 问题
相似问题