SOURCE

console 命令行工具 X clear

                    
>
console
		function ok(){


                //产生随机数
			var num =parseInt( Math.random()*30);
			
			var gucess = document.getElementById("number").value;
			if(num==gucess){
				document.getElementById("reslut").innerHTML="恭喜你!猜对了!";
			}else {
				document.getElementById("reslut").innerHTML="猜错了!";
			}
              
			 
						}

			
	<body>
         <div class="top" style="height:70px;border-bottom:1px solid #ddd;">
<img class="logoIndex" height="60" src="https://www.zenitour.com/img/logoIndex.png" style="margin-left:10px;margin-top:5px;">
</div>
<div class="content" style="text-align:center;margin-top:50px;height: 78%;">
			<label>请输入数字:范围[0,30]</label>
			<input type="text" id="number"/>
			<button onclick="ok()">确认</button>
			<p id="reslut"></p>
    </div>
		      <div id="bottom" style="text-align:center;border-top:1px solid #ddd;">
<span class="centerspan" style="font-size:10px">Copyright © 2017 Zenitour lnc All Rights Reserved 版权所有-哲途教育  渝ICP备13002955号-2</span>
	</body>
         html,body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            font-size:50px;
           
        }
        #reslut{
          color:red;
        }