Search DaTutorials:  
HOME
VB Script Tutorials
Introduction
Reference
Tutorials

If Statement

Description:


How to use the conditional if statement.

Code:

<html> <body> <script type="text/javascript">
function Today()
  d = Date()
  Thetime = Weekday(d)
  
  if Thetime = 1 then
     document.write("Today is Sunday and i can go to Hawaii.")
  else
     document.write("Today is a working day and i can't go to Hawaii.")
  end if
end function
</script> </head> <body> <p> <script type="text/vbscript"> Today(); </script> </p> </body> </html>

See working example:


Keywords:

VBScript: Function, Date , Weekday, if...then

DHTML: document.write


     Loans | Mobile Phones | Secured Loans | Debt Help | Car Insurance
Home     Link To Us     Ad With Us     Contact Us     Tell A Friend     Affiliates     Blog     MsOfficeHelp