August 1999
Intermediate to advanced
1488 pages
72h 53m
English
label: code;
The label keyword provides an identifier that can be used with break or continue to indicate where a program should continue execution. You can associate a block of JavaScript statements with each other using a label. When a label is called using break or continue, code is executed.
Listing 6.149 shows an example of the label statement in conjunction with break.
<html> <body> <script language="JavaScript"> <!–– Hide // define a label called doSomething doSomething: var x = 2+2; var y = 5*5; document.write("The value of 2+2 is: " + x + "<br>"); // define another label called doSomeMore doSomeMore: for(i=0; ... |
Read now
Unlock full access