您的位置:首页 > Web前端 > CSS

我的第一个JS/CSS程序

2015-10-21 12:48 567 查看
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<!--<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />-->

<title>无标题文档</title>

<script>

function displayTime() {

var elt = document.getElementById("clock");

var now = new Date();

//elt.innerHTML = now.toLocalTimeString();

elt.innerHTML = now.toLocaleString();

setTimeout(displayTime,1000);

}

window.onload=displayTime;

</script>

<style>

#clock {

font: bold 24pt sans;

background: #ddf;

padding: 10px;

border: solid black 2px;

border-radius: 10px;

}

</style>

</head>

<body>

<h1>Digital Clock</h1>

<span id="clock"></span>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: