1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <TITLE>forms.namedItem variations
</TITLE>
7 <FORM name=
"f" action=
"#">
8 <P><BUTTON name=
"b" type=
"button">dummy
</BUTTON></P>
10 <SCRIPT type=
"application/ecmascript">
11 function stringify(val)
13 var str = typeof(val);
15 if (str !=
"object" || val === null) {
19 for (var prop in val) {
20 if (!first) str +=
", ";
29 <SCRIPT type=
"application/ecmascript">
30 // iceweasel
2.0+dfsg-
1: object {b, nodeName, nodeValue, nodeType, parentNode, childNodes...
31 // ELinks
0.11.3: object {action, elements, encoding, length, method, name, target}
32 window.alert(
"document.forms.f=" + stringify(document.forms.f));
34 <SCRIPT type=
"application/ecmascript">
35 // iceweasel
2.0+dfsg-
1: object {b, nodeName, nodeValue, nodeType, parentNode, childNodes...
36 // ELinks
0.11.3: object {action, elements, encoding, length, method, name, target}
37 window.alert(
"document.forms[\"f\
"]=" + stringify(document.forms[
"f"]));
39 <SCRIPT type=
"application/ecmascript">
40 // iceweasel
2.0+dfsg-
1: object {b, nodeName, nodeValue, nodeType, parentNode, childNodes...
41 // ELinks
0.11.3: TypeError: document.forms.namedItem is not a function
42 window.alert(
"document.forms.namedItem(\"f\
")=" + stringify(document.forms.namedItem(
"f")));
44 <SCRIPT type=
"application/ecmascript">
45 // iceweasel
2.0+dfsg-
1: undefined undefined
46 // ELinks
0.11.3: object null
47 window.alert(
"document.forms.notfound=" + stringify(document.forms.notfound));
49 <SCRIPT type=
"application/ecmascript">
50 // iceweasel
2.0+dfsg-
1: undefined undefined
51 // ELinks
0.11.3: object null
52 window.alert(
"document.forms[\"notfound\
"]=" + stringify(document.forms[
"notfound"]));
54 <SCRIPT type=
"application/ecmascript">
55 // iceweasel
2.0+dfsg-
1: object null
56 // ELinks
0.11.3: TypeError: document.forms.namedItem is not a function
57 window.alert(
"document.forms.namedItem(\"notfound\
")=" + stringify(document.forms.namedItem(
"notfound")));