设计闹钟
没事人 2015-06-08 09:32:05 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css"/>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
<style type="text/css">#content{text-align:center;}</style>
<script type="text/javascript">
{function d(){
var c;
var d=new Date();获取时间
var a;
c=d.toLocaleString();时间转成字符串
sec.innerHTML=c;
a=d.toLocaleTimeString();
a=a.substring(0,5);提取时间中的时,分
ab.innerHTML=a;
if(a=="21:03")如果到了设定时间
{document.write("<audio src='tongkuai.mp3' autoplay></audio>");alert('12');}
//alert("l;lkl");
}
var handler=window.setInterval('d()',10000);
//alert("1");
}
</script>
</head>
<body>
<span id="sec"></span>
<span id="ab"></span>
</body>
</html>