简易的抽奖器
<script language="javascript" type="text/javascript">
var student = new Array("a","b","c","d","e","f");
var m=Math.round(Math.random()*(student.length-1));
document.write("<p align='center'><h1>幸运观众</h1></p>");
document.write("<p align='center'><h1>"+student[m]+"</h1></p>");
</script>
建议的网页时钟
<script language="javascript" type="text/javascript">
function webTime(){
var date = new Date();
document.getElementById("timediv").innerHTML=date.toLocaleString();
setTimeout("webTime()",1000);
}
</script>
<body onLoad="webTime()">
<div id="timediv" style="width:300px; height:40px; background-color:#FFF; border:dashed 1px #F33"></div>
</body>