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

Hour 6. Testing and Comparing Values > Using Multiple Conditions with switch

Using Multiple Conditions with switch

Often, you'll use several if statements in a row to test for different conditions. Here is one example of this technique:

if (button=="next") window.location="next.html";
if (button=="previous") window.location="prev.html";
if (button=="home") window.location="home.html";
if (button=="back") window.location="menu.html";


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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