HTML 2일차 입력상자 시간 표시

<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>JSP Test</title>
<script LANGUAGE="JavaScript">
<!--
function showTime()
{
var today = new Date();
var hour = today.getHours();
var minute = today.getMinutes();
var second = today.getSeconds();
if(second <= 9)
second = '0' + second;
if(minute <= 9)
minute = '0' + minute;
if(hour <= 9)
hour = '0' + hour;
var mytime = hour + '시 ' + minute + '분 ' + second + '초';
document.rclock.rtime.value = mytime;
}
setInterval("showTime()", 1000);
//-->
</script>
</head>
<body>
<form name="rclock">
<p align="center"><input type="text" name="rtime" size="12"></p>
</form>
</body>
</html>


result)

댓글 없음: