JS随机数的产生

版权声明:转载原创文章请以超链接形式请注明原文章出处,尊重作者,尊重原创!


恰饭广告




<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Document</title>
<style>
    #count{
        font-size: 20px;
        color: green;
        width: 400px;
        height: 30px;
        border: 1px solid black;
        margin: auto;
        line-height: 30px;
        text-align: center;
    }
    </style>
</head>
<body>
    <div id="count"></div>
    <script>
    //产生随机数
function count (){
    var i=Math.random()*(999999-100000)+100000;
    var j=parseInt(i,10);
    j="100000-999999随机产生:"+j;
    document.getElementById("count").innerHTML= j;
}
setInterval("count()",100);
    </script>
</body>
</html>  

原文链接:https://www.idaobin.com/archives/200.html

让我恰个饭吧.ヘ( ̄ω ̄ヘ)

支付宝 ——————- 微信
图片加载中图片加载中



恰饭广告

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

× 3 = 9