<script language="javascript">
<!--

function psm(){
        var now = new Date();
        var hours = now.getHours();
        var minutes = now.getMinutes();
        var seconds = now.getSeconds();
        var time = "" + ((hours > 12)? hours-12 : hours);
        time += ((minutes < 10)? ":0" : ":") + minutes;
        time += ((seconds <10)? ":0" : ":") + seconds;
        time += (hours >= 12)? " P.M":" A.M";
        document.form1.text1.value = time;
        timerID = setTimeout("psm()",1000);
}

//-->
</script>

 

<body onload="psm()">

<form name="form1">
<input type=text name="text1" size=10>
</form>

 

 

 

'html, script' 카테고리의 다른 글

움직일수 있는 레이어  (0) 2017.04.12
스톱워치 소스  (0) 2017.04.12
간단한 계산기 스크립트 소스  (0) 2017.04.12
자바스크립트 기본 몇가지  (0) 2017.04.12
확인유무 경고창발생 confirm  (0) 2017.04.12




+ Recent posts