這么寫對嗎?
<!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(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.round(Math.random()*10));
</script>
</head>
<body>
</body>
</html>
2016-04-23
舉報
2016-07-15
運行沒有問題,但是這么寫的話random()隨機(jī)數(shù)無法顯示,兩個數(shù)都顯示出來會比較直觀
2016-04-28
document.write(Math.round(Math.random()*10)+"</br>"); ??
document.write(Math.round((Math.random())*10));
兩種寫法都能實現(xiàn) 就是看的清晰問題了
2016-04-27
document.write(Math.round((Math.random())*10));
2016-04-26
你少寫了括號, (Math.random())*10
2016-04-23
語法對著