JavaScript出现意外的调用了方法或属性

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>sy8-4</title>
<script type="text/javascript">
        function select()
        {
            var s=Math.random();
            alert(s);
            var c=1/11;
            if(s<c)
                alert("0");
            else if (s<2*c) {
                alert("1");
            }else if (s<3*c) {
                alert("2");
            }else if (s<4*c) {
                alert("3");
            }else if (s<5*c) {
                alert("4");
            }else if (s<6*c) {
                alert("5");
            }else if (s<7*c) {
                alert("6");
            }else if (s<8*c) {
                alert("7");
            }else if (s<9*c) {
                alert("8");
            }else if (s<10*c) {
                alert("9");
            }else(s<11*c) {
                alert("10");
            }
        }
    </script>
</head>
<body>
     
    <input type="button" value="开始抽奖" onclick="select()">
</body>
</html>


小学徒_after
浏览 1479回答 3
3回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript