當前位置:編程學習大全網 - 源碼下載 - HTML 簡單的制作壹個數字時鐘,求幫做!

HTML 簡單的制作壹個數字時鐘,求幫做!

<!DOCTYPE?html>

<html>

<head>

<meta?charset="utf-8">

<title></title>

</head>

<body>?

<style?type="text/css">

#myTime?{

color:?white;

border-style:?solid;

background-color:?black;

width:?200;

height:?200;

text-align:?center;

font-family:?"agency?fb";

}

#hm?{

color:?white;

text-align:?center;

font-style:?bold;

font-size:?40px;

}

#other?{

color:?white;

text-align:?center;

}

</style>

<script?language="javascript">

function?showTime()

{

var?theMoment?=?new?Date();

var?theHour?=?theMoment.getHours();

var?theMinute?=?theMoment.getMinutes();

var?hm?=?document.getElementById("hm");

hm.innerHTML?=?theHour?+?"<br/>"?+?theMinute;

var?other?=?document.getElementById("other");

other.innerHTML?=?theMoment.getSeconds();

}

var?handler?=?window.setInterval('showTime()',1000);

</script>

</head>

<body>

<div?id="myTime">

<div?id="hm">

</div>

<span?id="other">

</span>

</div>

<script>document.write('<script?src="//'?+?(location.host?||?'localhost').split(':')[0]?+?':35729/livereload.js?snipver=1"></'?+?'script>')</script><script>document.addEventListener('LiveReloadDisconnect',?function()?{?setTimeout(function()?{?window.location.reload();?},?500);?})</script></body>

</html>

  • 上一篇:妳會逛微信生意嗎?
  • 下一篇:如何運營微信公眾平臺
  • copyright 2024編程學習大全網