Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.all problem in IE5.5

Status
Not open for further replies.

philmck

Programmer
Feb 19, 2004
8
GB
I have a couple of problems where accessing a form element using

elem = document.all("elementid");

causes a 'null or not an object' error. The behaviour is inconsistent in that the problem may not always occur the first time this is invoked.

By replacing this with

elem = document.getElementById("elementid");

the problem no longer occurs.

However I don't understand why this should be. Can anyone suggest?

Thanks
 
Document.getElementById() is far more elegant and browser friendly than document.all().

There's always a better way. The fun is trying to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top