[Javascript] difference

Peter Brunone peter at brunone.com
Fri Aug 22 13:16:55 CDT 2003


 
    The major advantage I can see, aside from more closely following the
IE object model, is that if you happen to have a variable or other
object named "lala", you'll still end up with the right reference by
using document.all.
 
Just two more cents on the pile...
 
Peter
 

-----Original Message-----
From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu] On Behalf Of Dan Costea
Sent: Friday, August 22, 2003 11:32 AM
To: [JavaScript List]
Subject: [Javascript] difference


    Hi,
 
I work with IE; I have an HTML object:
<input id="lala"/>
 
What is the difference between referencing it in js code with: 
var myVal = document.all['lala'].value;
or just 
var myVal = lala.value;
?
 
Thanks,
Dan Costea.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20030822/54e2debd/attachment.htm>


More information about the Javascript mailing list