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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:55:26+00:00 2026-06-06T14:55:26+00:00

In the function below chld is null only in IE, in firefox the javascript

  • 0

In the function below chld is null only in IE, in firefox the javascript works fine.

    var div = document.createElement("div");

    var divid = "dv" + num;

    div.setAttribute("ID", divid);

    div.setAttribute("value", num);



    var _text = document.createElement("input");

    _text.setAttribute("type", "text");

    _text.setAttribute("id", "txtAsName" + num);



    _text.setAttribute("name", "txtAsName" + num);


    var lbl = document.createElement("label");




    var _upload = document.createElement("input");

    _upload.setAttribute("type", "file");

    _upload.setAttribute("ID", "upload" + num);



    _upload.setAttribute("name", "uploads" + num);

    _upload.setAttribute("size", "80");



    var hyp = document.createElement("a");

    //hyp.setAttribute("style", "cursor:Pointer");
    hyp.style.cssText='cursor:Pointer';

    //hyp.setAttribute("onclick", "return RemoveDv('" + divid + "');");
    hyp.onclick=function() {RemoveDv(divid);};

    hyp.innerHTML = "Remove";



    var br = document.createElement("br");

    var _pdiv = document.getElementById("Parent");

    div.appendChild(br);

    div.appendChild(lbl);

    div.innerHTML += ' ';

    div.appendChild(_text);

    div.innerHTML += ' ';

    div.appendChild(_upload);

    div.innerHTML += ' ';

    div.appendChild(hyp);

    _pdiv.appendChild(div);

….

Here is the remove function

 function RemoveDv(obj) {

        var p = document.getElementById("Parent");

        var chld = document.getElementById(obj);


        p.removeChild(chld);

    }

Here is what the div tags look lie that I am trying to remove..

<div align="left" id="Parent">
    <div ID="dv1" value="1">
<div ID="dv2" value="2">

….

Interestingly even when I add this line of code “for debug sake” chld1 is still null

var chld1 = document.getElementById("dv1");

UPDATE:

It seems that there is nothing wrong with the code itself. If I run the same code in ie off my local code chld gets set. But if I run this code off our dev server ie does not see the element.

Any ideas why this could be?

  • 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-06-06T14:55:27+00:00Added an answer on June 6, 2026 at 2:55 pm

    This is a long shot, but try changing the capital case ID attribute on the div to lower case id. I don’t have IE and can’t test this out myself right now…sorry

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

Sidebar

Related Questions

When i use appendBox function below, first time it works fine and the same
I have the function below. Everything works fine except for the Push , Pop
The function below puts a search term $find in bold. It works just fine.
I have a javascript function below where it removes an appended file name from
In my Function below if I remove the tempString release statement it works just
This function below works in static pages but in dynamic pages it doesn't work
I have a function below which works perfectly, but now the client came back
The function below works perfectly for my purpose. The display is wonderful. Now my
The function below was used in two .php documents. This code works perfectly in
In my function below I am trying to understand why it only returns BLAH

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.