In this assignment, you are asked to send people you like to one page, people you don't like to another page, and everyone else to a third page. This should exercise your new understanding of if-then-else-if statements.

<html><head><title>Chapter 3 Assignment</title></head> <body> <script type = "text/javascript"> <!-- hide me from older browsers // get the visitor's name // var the_name = prompt("What's your name?", ""); // If the name is thau, dave, pugsly, or gomez, // send the visitor to Sesame Street. // If it's darth vader, the evil emperor, or jar jar binks, // send the visitor to the American Psychological Association // for some therapy. // If it's none of the above, send him or her to the New York Times. if ((the_name == "thau") ...

Get The Book of JavaScript, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.