<!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>点名</title>
<script language="javascript" type="text/javascript">
var status = 1;
var name = new Array('小刘','小王','小红','小张','小黑','小李');
function getname(){
return name[Math.floor(Math.random()*name.length)];
}
function showname(){
document.getElementById("name").innerHTML = getname();
setTimeout("showname",200);
}
function goname(){
intimer = setInterval(showname, 200);
}
function stopname(){
if(status == 1){
clearInterval(intimer);
status = 0;
}else{
intimer = setInterval(showname, 200);
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>