Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 538021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:59:17+00:00 2026-05-13T09:59:17+00:00

document.getElementById doesn’t seem to work across all browsers (I mean some old ones) and

  • 0

document.getElementById doesn’t seem to work across all browsers (I mean some old ones) and I am sure there are developers who are not aware of this.

What solutions would you suggest to make it cross-browser?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:59:18+00:00Added an answer on May 13, 2026 at 9:59 am

    If document.getElementById doesn’t work then either:

    • You’re doing it wrong (invalid HTML, trying to access names instead of IDs, etc)

    or

    • You’re working with Netscape 4.x and Internet Explorer 4.x

    There are three ways to deal with browsers of this era.

    • Tell people to upgrade. They are unmaintained, security hole ridden nightmares for user and author alike.
    • Build on stuff that works and make sure your JS checks for the existence of getElementById and friends before trying to use them ( if (!document.getElementById) { return false; /* Insufficient DOM to bother with JS here */ } )
    • Learn about document.all and document.layers
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using document.GetElementById(thingieID) doesn't seem to work. Can anyone help this DOM newbie?
This doesn't work: if(document.getElementById(iframe).innerHTML==''){ Is there a safe browser reliable way to check an
The following doesn't work... (at least not in Firefox: document.getElementById('linkid').click() is not a function)
Why doesn't the following work for me? <script> document.getElementById('lbltipAddedComment').innerHTML = 'Your tip has been
Why doesn't the following work for me? <script> document.getElementById('lbltipAddedComment').innerHTML = 'Your tip has been
Is there a function like document.getElementById(FirstDiv).clear() ?
I am guessing getElementById doesn't work with radio buttons when you want to get
document.getElementById(main).src = '02.jpg'; works but $('#main').src = '02.jpg'; doesn't
document.getElementById(gD + gDay + gMonth + gYear).setAttribute(class, gDay gDayHover); This works fine in all
I have encountered odd behavior when using document.getElementById tonight. Duplicated in Firefox 3 and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.