Exercise: Branching

Here a condition is used to check the value entered. If a string other than "password" is entered, no change is made.

Modify the example to show the response "Too bad." if a string other than "password" is entered.

Note:

Hints:

  • undefined

Solution to the exercise

Here is a possible solution to the exercise.

Note:

Hints:

  • undefined
1
2
window.onload = startFunction;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
<!DOCTYPE html>
<html lang="en">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX