<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>If statement example</title> </head> <body> <script type="text/javascript"> var currDate = new Date(); var currTime = currDate.getHours(); document.write("Current Date : " + currDate + "<br/>"); if(currTime < 12) { document.write("AM"); } else if(currTime >= 12) { document.write("PM"); } </script> </body> </html>
'I/T > JavaScript' 카테고리의 다른 글
Javascript Array 사용법 (0) | 2009.09.24 |
---|---|
Javascript switch문 사용법 (0) | 2009.06.16 |
Javascript for문 사용법 (0) | 2009.06.16 |
JavaScript Select 이벤트 처리 (1) | 2009.04.27 |
JavaScript <tr>태그, onclick 과 onmouseover 이벤트 처리 (0) | 2009.04.27 |