Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


document.getElementById fails

Posted on 2006-10-23
Medium Priority
Last Modified: 2006-11-18
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).....plus it was working before I made the latest round of changes...

But it keeps coming up null.

Any suggestions would be appreciated.

Question by:codequest
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 30

Accepted Solution

callrs earned 1600 total points
ID: 17792615
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">
LVL 54

Assisted Solution

b0lsc0tt earned 300 total points
ID: 17792701

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.


Author Comment

ID: 17792714
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.
LVL 41

Assisted Solution

HonorGod earned 100 total points
ID: 17796179
1 possibility is a syntax error in the element associated with the specified ID

Author Comment

ID: 17796190
Thanks for input.  This is resolved...must have been what callrs suggested.   Points to others for cross-validation.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question