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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:40:09+00:00 2026-06-13T12:40:09+00:00

My question: Why is this condition being ignored in IE 8? if (dynCheck[0].innerHTML ==

  • 0

My question:

Why is this condition being ignored in IE 8?

if (dynCheck[0].innerHTML == 'Empty' || dynCheck[0].innerHTML == "")` {continue}

More details:

I have a loop that is storing an array of list items into another array. I have a condition that checks if the first list item has a value of “Empty” if it does then continue. For some reason IE8 is ignoring this condition. Could it be because I’m checking against an Array holding a value?

Here is the entire loop:

for(var dynEl = 1; dynEl <= dynLists; dynEl++) {

        //Get Array of List Items
        var dynCheck = document.getElementById('loc' + dynEl).getElementsByTagName('li');

        //Check if it is empty or not
        if (dynCheck[0].innerHTML == 'Empty' || dynCheck[0].innerHTML == "") {continue}

        //If there is content then add it to the Array
        dynElArr[dynElIndx] = dynCheck;

        //Increment Index
        dynElIndx++;
}

Thank you!

  • 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-13T12:40:10+00:00Added an answer on June 13, 2026 at 12:40 pm

    innerHTML is not necessarily the same between browsers, especially in regards to whitespace between nodes.

    Case 1:

    <ul><li>Item</li></ul>
    

    Case 2:

    <ul>
      <li>Item</li>
    </ul>
    

    May give different results.

    Try .nodeValue or select the actual textnode first and use .textContent/.nodevalue

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

Sidebar

Related Questions

This question bugs me since a long time: Can I have a condition that
i know that this is basic objective C question but I have serious problems.
I have a foreach loop that breaks during the loop in the condition of
Weird question this, going round in circles. I have 2 pages. Page 1. Has
I believe my question this time is simple. Let say I have a webpage,
hopefully a pretty simple question this time. I have a Select method in a
Being spotted in context of this question this seemingly inconsistent behavior can be reproduced
I have a schema like this <h1> 5/2009 <br/> Question: This is the question
Okay this question is very simple: I have a facebook page, and a website.
This is directly inspired by this question . There are numerous references/statements that bitwise

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.