标签:utf-8 oct rip div type second int time meta
随机点名程序
document.write(Math.random());
var stu = ["张三", "王五", "张二", "张一", "石大", "郭三", "冯二", "平五"];
var ran = Math.random();
var ran = ran * stu.length;
var ran = Math.floor(ran);
document.write(stu[ran]);
万年历
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div id="a"></div>
</body>
</html>
<script>
function jgxs(){
var time = new Date();
var year = time.getFullYear();
var month = time.getMonth()+1;
var day = time.getDate();
var hour = time.getHours();
var min = time.getMinutes();
var sec = time.getSeconds();
var time2 = year+"年"+month+"月"+day+"日"+" "+hour+":"+min+":"+sec;
document.getElementById("a").innerHTML=time2;
}
window.setInterval("jgxs()",500)
</script>
标签:utf-8 oct rip div type second int time meta
原文地址:http://www.cnblogs.com/cmzhphp2017/p/7599804.html