JS writing the name register

Source: Internet
Author: User
Tags button type

1<! DOCTYPE html>234<meta charset= "UTF-8" >5<title> Name Register </title>6<style type= "Text/css" >7*{8margin:0;9padding:0;Ten         } One #outer { A margin:50px; - padding:50px; - width:600px; the             /*height:600px;*/ -border-radius:20px; -background-Color:orange; -         } + #box { -margin-top:20px; + padding:20px; Abackground-Color:grey; atfont-size:40px; -font-Weight:bold; -         } - #bt { - width:80px; -margin-top:5px; in padding:10px; -background-Color:green; tofont-size:20px; +font-Weight:bold; - Cursor:pointer; the         } *  $</style>Panax Notoginseng -<body> the<center> +<<div id= "outer" > A<div id= "box" ></div> the<button type= "button" id= "BT" >start</button> +</div> -</center> $  $<script type= "Text/javascript" > -         varnamelist=["Lionel Messi", "Neymar", "Luis Suarez", "Illesta", "Busquets", "Pico", "Roberto", "Lakitic", "Javier Mascherano"] -         varFlag=0; the         varBt=document.getelementbyid ("BT"); -         varBox=document.getelementbyid ("box")Wuyibt.onclick=function(){ the             if(flag==0){ -Flag=1; WuBt.innerhtml= "Stop"; -Bt.style.backgroundcolor= "Red"; About Show (); $             } -             Else{ -Bt.innerhtml= "Start"; -Bt.style.backgroundcolor= "Green"; A cleartimeout (flag); +Flag=0; the             } -  $         } the         functionShow () { the             varNum=math.floor (Math.random () *1000)%namelist.length; theBox.innerhtml=Namelist[num]; theFlag=settimeout ("Show ()", 100); -         } in</script> the</body> the

JS writing the name register

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.