July 1998
Intermediate to advanced
1456 pages
65h 5m
English
for — NN 2 IE J1 ECMA 1
A construction that allows repeated execution of statements, usually for a controlled number of times.
for ([initExpression]; [condition]; [updateExpression]) {statements}
var userEntry = document.forms[0].entry.value
var oneChar
for (var i = 0; i < userEntry.length; i++) {
oneChar = userEntry.charAt(i)
if (oneChar < "0" || oneChar > "9") {
alert("The entry must be numerals only.")
}
}Read now
Unlock full access