有哪位大哥能帮我做一下么

解决方案 »

  1.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript">
    function zhitouzi(){
    var newdiv = document.getElementById("jg");

    var cj = document.getElementById('cj').value;
    var num = parseInt(1+Math.random()*5)
    if(cj>=700){
    if(num%2==0){
    newdiv.innerHTML = "点数:"+num+",上清华";
    }else{
    newdiv.innerHTML = "点数:"+num+",上北大";
    }
    }else if(cj>=600&&cj<700){
    if(num==1 || num==2){
    newdiv.innerHTML = "点数:"+num+",上交大";
    }else if(num==3 || num==4){
    newdiv.innerHTML = "点数:"+num+",上西电";
    }else{
    newdiv.innerHTML = "点数:"+num+",上政法";
    }
    }else if(cj<600){
    newdiv.innerHTML = "骚年补考吧!";
    }
    }
    </script>
    <title>Insert title here</title>
    </head>
    <body>
    输入小明成绩:<input id = 'cj' value=""/><button onclick="zhitouzi()">掷骰子</button>
    <div id = 'jg'></div>
    </body>
    </html>