• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Hour 4. How JavaScript Programs Work > Conditional Statements

Conditional Statements

While event handlers notify your script when something happens, you may want to check certain conditions yourself. For example, did the user enter a valid email address?

JavaScript supports conditional statements, which allow you to answer questions like this. A typical conditional uses the if statement, as in this example:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint