HighDots Forums  

Re: Qn from Novice

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: Qn from Novice in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Martin Honnen
 
Posts: n/a

Default Re: Qn from Novice - 12-03-2004 , 10:05 AM








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/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.