|
The Switch-Case StructureA switch-case structure has the same form as in Java: <switch expression> <case value1> HTML for case 1. <break> <case value2> HTML for case 2. <break> <default> HTML for the default case. <break> </switch> You can have as many cases as you like. The values
<switch animal.name> <case "elephant"> <case "rhinocerous"> This is the HTML for large animals. <break> <case "squirrel"> <case "gecko"> This is the HTML for small animals. <break> <case favoriteAnimal.name> This is the HTML for the user's favorite animal. <break> <default> This is the HTML for other animals. <break> </switch> |
|