課程
/前端開發(fā)
/JavaScript
/JavaScript進(jìn)階篇
如題所示
2014-11-20
源自:JavaScript進(jìn)階篇 7-16
正在回答
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Math </title><script type="text/javascript">var i=Math.random()*10document.write(i+"<br />");document.write(Math.round(i));</script></head><body></body></html>
這個(gè)變量的方法也很好的~
可以用向上取整或者向下取整,不用四舍五入也可以
阿拉不斯加 提問者
舉報(bào)
本課程從如何插入JS代碼開始,帶您進(jìn)入網(wǎng)頁(yè)動(dòng)態(tài)交互世界
2 回答我這樣做對(duì)吧?,還有別的方法嗎?
4 回答getElementById()方法與getElementsByTagName()方法的區(qū)別是???
3 回答刪除方法中的lastChild
1 回答刪除方法的應(yīng)用
2 回答還有沒有更簡(jiǎn)潔的方法。
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2015-07-23
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Math </title>
<script type="text/javascript">
var i=Math.random()*10
document.write(i+"<br />");
document.write(Math.round(i));
</script>
</head>
<body>
</body>
</html>
這個(gè)變量的方法也很好的~
2014-11-20
可以用向上取整或者向下取整,不用四舍五入也可以