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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:18:53+00:00 2026-05-23T17:18:53+00:00

Why is this simple thing not working in IE 9? It works just fine

  • 0

Why is this simple thing not working in IE 9? It works just fine i FF and Chrome.

<script language="javascript" type="text/javascript">
    function displayBusinessCardData() {
        var xmldata = document.getElementById("xmldata1");
        var bizCard = xmldata.getElementsByTagName("BusinessCard")[0];

        var name = "Name: " +  bizCard.getElementsByTagName("name")[0].firstChild.data;
        var phone1 = "Phone: " +  bizCard.getElementsByTagName("phone")[0].firstChild.data;
        var phone2 = "Phone: " + bizCard.getElementsByTagName("phone")[1].firstChild.data;
        var phone3 = "Phone: " + bizCard.getElementsByTagName("phone")[2].firstChild.data;
        var email = "Email: " + bizCard.getElementsByTagName("email")[0].firstChild.data;

        alert("BusinessCard Data: \n\n" + name + "\n" + phone1 + "\n" + phone2 + "\n" + phone3 + "\n" + email);
    }
</script>

<xml id="xmldata1" style="display:none">
<BusinessCard>
    <name>Joe Marini</Name>
    <phone type="mobile">(415) 555-4567</phone>
    <phone type="work">(800) 555-9876</phone>
    <phone type="fax">(510) 555-1234</phone>
    <email>joe@joe.com</email>
</BusinessCard>
</xml>

<a href="javascript:displayBusinessCardData()">Show Business Card Data</a>
</body>

It fails with “xmldata.getElementsByTagName(“BusinessCard”)[0];” with the result being null for bizCard.

  • 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-23T17:18:53+00:00Added an answer on May 23, 2026 at 5:18 pm

    I think it is because in IE, elements with a non-standard tag name cannot contain other elements.

    Try once xmldata.canHaveChildren, it should return false.

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

Sidebar

Related Questions

This might be a very simple thing for you gurus, but I'm not familiar
Im a javascript newbie and would need some help with this simple thing... I
I think this is a simple question, but I can not find the answer
I'm trying to figure this simple thing but I'm actually embarrassed to ask such
I'm sure this is a simple thing to do but in php I need
My Google-Fu is weak today, hopefully this is a simple thing. I need to
Please forgive my programming knowledge. I know this is a simple thing, but I
This might be a very simple thing. Check out the normal sql query below
This should be a really really simple thing, but for some reason it is
I'm sure this is a really simple thing, but I haven't worked in C++

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.