July 1998
Intermediate to advanced
1456 pages
65h 5m
English
eval() — NN 2 IE J1 ECMA 1
eval(string)Returns an object reference of the object described as a string in
the parameter of the function. For example, if a form has a sequence
of text fields named entry1,
entry2, entry3, and so on, you
can still use a for loop to cycle through all
items by name if you let the eval() function
convert the string representation of the names to object references:
for (var i = 1; i <=5; i++) {
oneField = eval("document.forms[0].entry" + i)
oneValue = oneField.value
...
}Object reference.
string
Any string representation of an object reference.
Read now
Unlock full access