Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 582
  • Last Modified:

document.getElementById fails

why might    document.getElementById("XYZ")     fail?    I can look at the page source and see the table ID "XYZ" in the page...and can only find one such ID (searched, using pagespy) it was working before I made the latest round of changes...

But it keeps coming up null.

Any suggestions would be appreciated.

3 Solutions
Syntax error In the HTML or in the javascript. Try Firefox browser to pinpoint errors (In FF: Tools -> Javascript Console)

Is there an equal sign? Matched quotes? Matched case? etc.

<table id="XYZ">
b0lsc0ttIT ManagerCommented:

What were the changes you made?  Besides the good things mentioned by Callrs the message may be appearing because of what you are looking for when you get Null.  What is the line that is giving the Null?

Let me know if you have any questions or need more information.

codequestAuthor Commented:
Thanks for input.  Problem shifted...I'm working on a puzzle and this was a test case.  Points will be awarded...I'll leave this open a while to see if need reappears.
1 possibility is a syntax error in the element associated with the specified ID
codequestAuthor Commented:
Thanks for input.  This is resolved...must have been what callrs suggested.   Points to others for cross-validation.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now