peter wrote:
Quote:
(i'm new to javascript) I found the following Javascript and is confused by
its syntax. Why the expression "window.status=input.form[0].value;" is
valid (i verified this in ie6) and has the same result as the expression
"window.status=input.form.elements[0].value"?
As fas as I understand, "input.form" represents the form object. And, this
form object isnt an array. Why we can use array accessing syntax on an
ordinary object? |
Well what you think is "array accessing syntax" is simply a way to
access properties of an object in JavaScript, see
http://www.jibbering.com/faq/faq_not..._brackets.html
--
Martin Honnen
http://JavaScript.FAQTs.com/