I/T/JavaScript2009. 6. 16. 15:50
<SPAN id=tx_marker_caret></SPAN><?xml version="1.0" encoding="EUC-KR" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR" />
		<title>Switch statement example</title>
	</head>
	<body>
		<script type="text/javascript">
			var localDate = new Date();
			var localTime = localDate.getHours();
			
			document.write("Local Date : " + localDate + "<br/>");
			
			switch (localTime)
			{
				case 4:
					document.write("4 hour");
				case 9:
					document.write("9 hour");
				default:
					document.write("else");
			}
		</script>
	</body>
</html>

'I/T > JavaScript' 카테고리의 다른 글

Javascript escape&unescape  (0) 2009.09.24
Javascript Array 사용법  (0) 2009.09.24
Javascript if문 사용법  (0) 2009.06.16
Javascript for문 사용법  (0) 2009.06.16
JavaScript Select 이벤트 처리  (1) 2009.04.27
Posted by 황타