[thelist] javascript var question

Tab Alleman talleman at Lumpsum.com
Wed May 3 13:58:16 CDT 2006


Pretty sure you can't assign a variable to a property of an object.   You might try something like this, however:

 var o = document.getElementById("myinput");
 o.value = "my text";

OR maybe you'd achieve your desired goal by something like:

var o = "my text";
...
document.getElementById("myinput").value = o;

> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org]On Behalf Of Brian Cummiskey
> Sent: Wednesday, May 03, 2006 2:47 PM
> To: thelist at lists.evolt.org
> Subject: [thelist] javascript var question
> 
> 
> Why does this work:
> 
> document.getElementById("myinput").value = "my text";
> 
> 
> 
> But this doesn't:
> 
> var o = document.getElementById("myinput").value;
> o = "my text";
> 
> 
> -- 
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester 
> and archives of thelist go to: http://lists.evolt.org 
> Workers of the Web, evolt ! 
> 



More information about the thelist mailing list