Advertisement
honghoavi

Conditional statements if-else-switch 02

Jun 28th, 2012
1,838
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript"><!--
  2. // if 'time' > 11, prints Hello!
  3. // Otherwise "It's ... o`clock"
  4. var d = new Date()
  5. var time = d.getHours()
  6. if (time>11) {
  7.   document.write("<b>Hello!</b>")
  8. }
  9. else {
  10.   document.write("<b>It`s " +time+ " o`clock</b>")
  11. }
  12. --></script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement