Guess number Game

Source: Internet
Author: User

<!doctype html>body,h1,h2,h3,h4,h5,h6,p,dl,dd,ul,ol,form,input,textarea,th,td,select{margin:0px;padding:0px;}; Em{font-Style:normal;} Li{list-Style:none;} A{text-Decoration:none;} Img{border:none;vertical-Align:top;} table{Border-Collapse:collapse;} Input,textarea{outline:none;} Textarea{resize:none;overflow:auto;} Body{font-size:12px;font-family: "Microsoft Ya Hei";} body{Background:url (img/BEIJING.JPEG);} #wrap {width:300px;    Margin:auto; Text-Align:center;    }h1{color: #fff; Font-size:50px; Margin-top:50px;    Display:block; Font-Weight:bold;    } p{padding:10px; Text-Align:center;    MARGIN:OPX; Background:rgba (255,255,255,0.65); Overflow:hidden;}    input{width:300px;    height:80px;    Color: #1A154F; Margin-top:20px; Font-size:36px;    Border:none; Background:rgba (255, 255, 255, 0.65); } #text1 {text-Align:center; Transition:all0. 5s; Font-family: "Microsoft Ya Hei"; } #btn {margin-top:20px;    Cursor:pointer; Font-family: "Microsoft Ya Hei";    } #info {width:260px;    height:150px; Background:none Repeat scroll0% 0% Rgba (65, 58, 87, 0.83);    border:10px solid #FFF;    Color: #FFF; Text-Align:left;    padding:10px; Line-height:28px; }                </style><script type= "Text/javascript" >window.onload=function (){    varOwrap = document.getElementById (' Wrap '); varOtext = document.getelementsbytagname (' input ') [0]; varOBTN = document.getelementsbytagname (' input ') [1]; varop = document.getElementsByTagName (' P ') [0]; varnum = Math.Round (math.random () *100); varsum = 0; varTimer =NULL; //InitializeOtext.value = ' Please enter a number '; Flash (Otext,500, Owrap); functionFlash (OBJ,FREQUENCY,OWRAP,ENDFN) {flag= 1; varONFF = 1; Obj.flasher= SetInterval (function ()        {                if(flag) {Obj.style.background= ' #fff '; }            Else{Obj.style.background= ' Rgba (255, 255, 255, 0.65) '; } Flag= !Flag; Owrap.onmouseover=function() {clearinterval (obj.flasher); Obj.style.background= ' Rgba (255, 255, 255, 0.65) ';        }},frequency)}; Obtn.onclick=function ()    {                if(Otext.value = = "") {alert (' Please enter a number '); }        Else        {                        if(Num < otext.value && Sum < 10) {alert (' Big. '); Op.innerhtml+ = '  'sum++                            }            Else if(num > Otext.value && sum < 10) {alert (' Small Oh '); Op.innerhtml+ = '  'sum++; }            Else if(num = = Otext.value && Sum < 10) {op.innerhtml= ' ';  for(vari = 0; I < 10; i++) {op.innerhtml+ = '  '; } otext.value= ' Congratulations on the right answer '; Flash (Otext,500); }            Else if(Sum = = 10) {Otext.value= ' I'm sorry '; }        }            };};</script>Game Rules<br/><br/>The system randomly generates a0~100the number of random numbers, the player has 10 chance to guess, the system will prompt relative to the true value of the high and low. </div> </div></body>

Guess number Game

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.