This article mainly introduces the use of JavaScript to do a random naming process, tested, the effect is quite good, need friends can refer to the following
Code as follows: <! 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=gb2312 "> <title> naming </title> <script language=" javascript "type=" text/ JavaScript > var status = 1; var name = new Array (' Fan Peng ', ' Zhang Zihan ', ' Dawn ', ' Sun Ti ', ' Nate ', ' Wang Hong gang ', ' Zengfanding ', ' Li Huan ', ' Zhu Ying ', ' King Lisa ', ' Zheng Lin ', ' Zhu Zhenjia ', ' King One ', ' undeterred ', ' Gou super ', ' Wutongguang ', ' Liang Liang ', ' Liu June ',; function getname () { return Name[math.floor ( Math.random () *name.length)]; } function showname () { document.getElementById ("name"). InnerHTML = GetName (); settimeout ("ShowName"); } function goname () { Intimer = SetInterval (ShowName, ; } function Stopname () { if (status = 1) { clearinterval (intimer); status = 0; }el se{ Intimer = setinterval (showname); status = 1; } } </script> <style> #name { border:1px solid #000; margin:auto; font-size:36px; color: #000000; width:108px; height:1em; cursor:pointer; text-align: center; } </style> </head> <body onload= "Goname ()" > <div id= "name" Onclick= "Stopname ()" ></div> </body> </html>