728x90
<HTML> 
<HEAD> 
<TITLE> JASKO Sample<span class="key1" onclick="keyword_open('/kview.php?kd=+Script')"> Script</span> </TITLE> 

<SCRIPT LANGUAGE="JavaScript"> 
<!-- 

window.status="로딩중..." 

function timeNow() 
{ 
now = new Date() 
var hours = now.getHours() 
var minutes = now.getMinutes() 
var seconds = now.getSeconds() 
var ap = "오전" 
  if (hours > 12) 
      {var ap = "오후" , hours = hours-12 ;} 
  if (minutes < 10) 
      {minutes = "0"+minutes} 
  if (seconds < 10) 
      {seconds = "0"+seconds} 

/********************** 상태바 시계 *******************/ 
window.status = hours+":"+minutes+":"+seconds+" "+ap 
/********************** 상태바 시계 *******************/ 

/********************* 텍스트 상자 시계 ************************/ 
document.time.clock.value = hours+":"+minutes+":"+seconds+" "+ap 
document.time.clock.size = document.time.clock.value.length 
/********************* <span class="key1" onclick="keyword_open('/kview.php?kd=%ED%85%8D%EC%8A%A4%ED%8A%B8+')">텍스트 </span>상자 시계 ************************/ 

/************************* 버튼 시계 *****************************/ 
document.time.butclock.value = hours+":"+minutes+":"+seconds+" "+ap 
/************************* 버튼 시계 *****************************/ 

/********************* 타이틀 바 시계 ***************/ 
document.title = hours+":"+minutes+":"+seconds+" "+ap 
/********************* 타이틀 바 시계 ***************/ 

setTimeout("timeNow()",1000) 

} 

function timeAlert() 
{ 
now = new Date() 
var hours = now.getHours() 
var minutes = now.getMinutes() 
var seconds = now.getSeconds() 
var ap = "오전" 

  if (hours > 12) 
      {var ap = "오후" , hours = hours-12 ;} 
  if (minutes < 10) 
      {minutes = "0"+minutes} 
  if (seconds < 10) 
      {seconds = "0"+seconds} 
alert(hours+":"+minutes+":"+seconds+" "+ap) 
} 

// --> 
</SCRIPT> 

</head> 

<body onLoad="timeNow()"> 
<CENTER><H3>다섯가지 시계표기법</H3></CENTER> 

<p align=center> 
<form name=time> 
<input name=clock size=10 value="로딩 중입니다..."> 
<input type=button name=butclock value="로딩 중입니다..."> 
<input type=button name=showTime value=" 시계 보기 " onClick="timeAlert()"> 

</form> 

<TABLE width=50% align=center bgcolor=teal> 
<TR> 
<TD bgcolor=ivory> 
<LI>1번째 : 제목표시줄 
<LI>2번째 : 상태표시줄 
<LI>3번째 : 텍스트상자 
<LI>4번째 : 버튼 
<LI>5번째 : 버튼클릭후 팝업 

</TD> 
</TR> 
</TABLE> 
</body> 
</html> 
728x90

'Developer > JavaScript' 카테고리의 다른 글

웹표준에 맞는 form 코딩법  (0) 2007.05.25
한줄로 끝내는 롤오버마우스 스크립트  (0) 2007.05.25
랜덤 이미지 출력  (0) 2007.05.25

+ Recent posts