Can't assign the value of an input element in ID??

D

dave

IE7 is generating an "object doesn't support this property or
method.." when i do

foo = document.getElementById('bar').value;

however, if I do
alert(document.getElementById('bar').value); I get the value....

Is this a known bug or am I missing something?
 
S

SAM

dave a écrit :
IE7 is generating an "object doesn't support this property or
method.." when i do

foo = document.getElementById('bar').value;

before end of loading or after ?
 
D

dave

after... the alert works but not the assign

After some testing, it became apparent that assigning it to "keywords"
was causing the error. I guess M$ made up some javascript reserved
words.
 
T

Thomas 'PointedEars' Lahn

dave said:
dave a écrit :
IE7 is generating an "object doesn't support this property or
method.." when i do
foo = document.getElementById('bar').value;
before end of loading or after ?
[...]
after... the alert works but not the assign

After some testing, it became apparent that assigning it to "keywords"
was causing the error. I guess M$ made up some javascript reserved
words.

This has nothing to do with reserved words. Probably you have an element
with ID or name `foo' in your document. If you had declared the identifier,
there would not be such a long scope chain where to find the host object
whose [[Put]] implementation causes this error:

var foo = ...;


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top