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 3235586
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:31:25+00:00 2026-05-17T17:31:25+00:00

For some reason, this is happening very vaguely. Its working sometimes and sometimes it

  • 0

For some reason, this is happening very vaguely. Its working sometimes and sometimes it is not. The same line of code, for the different “myid” under same parent, the line –

document.getElementById("myid").parentNode is returning null.

I am quite sure that element “myid” is not a root element and its parent is a DIV which needs to be returned. I am using Firefox 3.6.10 version.

Can anyone suggest any reason why this could be happening?

EDIT: The “myid” here is some kind of a textbox or any other control element. But the parentnode is always DIV. Any controls we add are always wrapped under a DIV. So basically when something on the screen refreshes, we get the parent node and replace the innerhtml. The innerhtml could be anything.

given below is the html I have –

<div style="height: 334px; width: 769px; position: relative;">

    <span style="display: inline-block; height: 13px; width: 61px; position: absolute; left: 393px; top: 84px;" bizappid="System856UserGroupAppPoint156d5elabel300" tabindex="-1" id="System856UserGroupAppPoint156d5elabel300">User Group</span>   

    <input type="text" style="height: 20px; width: 221px; position: absolute; left: 503px; top: 77px;" bizappid="System856UserGroupAppPoint156d5etextBox190" class="formtextbox" tabindex="400" id="System856UserGroupAppPoint156d5etextBox190" readonly="readonly" name="System856UserGroupAppPoint156d5etextBox190">
</div>

In this Html, assume I am getting ParentNode for Span element, but I am not getting the same parentNode for the Input text element. Also one more strange thing is, I just added a check saying if getelementbyid is not null, then check its parentNode. Then further added if parentNode is not null then do refresh operation. Now the control is not coming inside the parentNode not null condition.

  • 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-17T17:31:25+00:00Added an answer on May 17, 2026 at 5:31 pm

    If the same “id” value is shared by two or more elements on your page, then getElementById (may) return a node list instead of a DOM reference. A node list instance has no “parentNode” property.

    Do not re-use “id” values for more than one element is the moral of this story.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason this line of code is giving me quite a problem. struct
For some reason this isn't working, am I missing something obvious? RewriteRule ^(.*)infopopup.html$ /acatalog/infopopup.html
For some reason this statement is working fine: vms.Where(vm => vm.MessageType == ValidationMessage.EnumValidationMessageType.Warning) But
For some reason this program is saying that 'switch' is not defined. What is
for some reason this code wont work, it doesn't seem to read the javascript.php
For some reason this () character shows up in Firefox 10 randomly throughout my
For some reason this text isn't being centered. #highlightheader { background-color:#006600; color:white; font-size:30px; text-align:center;
For some reason This php script won't echo anything: <?php setcookie(pop,'hi',time()+604800); echo $HTTP_COOKIE_VARS['pop']; ?>
For some reason this function confused me: def protocol(port): return port == 443 and
For Some reason this query doesn't work in SSIS Select IDLOGARCHIVOS, NOMBREARCHIVO, FECHACREACION from

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.