HTML中只显示时分秒的代码!
2个回答
展开全部
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>demo</title>
<script>
window.onload = function(){
var monitor = document.getElementById('monitor');
setInterval(function(){
var now = new Date();
monitor.innerHTML = now.getMinutes()+':'+now.getSeconds();
},1000);
};
</script>
</head>
<body>
<div id="monitor"></div>
</body>
</html>
更多追问追答
追问
没有小时
我给你50财富!
展开全部
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>demo</title>
<script>
window.onload = function(){
var monitor = document.getElementById('monitor');
setInterval(function(){
var now = new Date();
monitor.innerHTML = now.getHours()+':'+now.getMinutes()+':'+now.getSeconds();
},1000);
};
</script>
</head>
<body>
<div id="monitor"></div>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>demo</title>
<script>
window.onload = function(){
var monitor = document.getElementById('monitor');
setInterval(function(){
var now = new Date();
monitor.innerHTML = now.getHours()+':'+now.getMinutes()+':'+now.getSeconds();
},1000);
};
</script>
</head>
<body>
<div id="monitor"></div>
</body>
</html>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询