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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:25:44+00:00 2026-05-15T09:25:44+00:00

This is an odd one, for whatever reason, getting the children of an element

  • 0

This is an odd one, for whatever reason, getting the children of an element doens’t work in Camino browser. Works in all other browsers. Anyone know how to fix this? Google is no help 🙁

var site_result_content = document.getElementById(content_id);
    site_child_nodes = site_result_content.children;
    alert('started');
    for(i=0;i<site_child_nodes.length;i++) {
        alert('cycle1');
        document.getElementById(site_child_nodes[i].id).className = 'tab_content';
        ShowHide(site_child_nodes[i].id,'hidden');
    }

In this case, the started alert is called, but the cycle1 isn’t.

  • 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-15T09:25:45+00:00Added an answer on May 15, 2026 at 9:25 am

    Use childNodes instead. children started out as a proprietary property that in IE, whereas childNodes is in the W3C DOM spec and is supported by every major browser released in the last decade. The difference is that children contains only elements whereas childNodes contains of all types, in particular text nodes and comment nodes.

    I’ve optimized your code below. You should declare all your variables with var, including those used in loops such as i. Also, document.getElementById(site_child_nodes[i].id) is unnecessary: it will fail if the element has no ID and is exactly the same as site_child_nodes[i] otherwise.

    var site_result_content = document.getElementById(content_id);
    var site_child_nodes = site_result_content.childNodes;
    alert('started');
    for (var i = 0, len = site_child_nodes.length; i < len; ++i) {
        if (site_child_nodes[i].nodeType == 1) {
            alert('cycle1');
            site_child_nodes[i].className = 'tab_content';
            ShowHide(site_child_nodes[i].id, 'hidden');
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, this is an odd one for some reason. UPDATE is updating fields, but
This is an odd one. I added a file to a project, thought I
I guess this is an odd one, and the answer is most likely it
This is a very odd one and I'm not sure how to proceed. Basically,
This is an odd one, not one I've come across before. My project complies
Odd one this... The following command returns what I would expect when I run
Odd one this. I am using NHibernate with one website. I have configured log4net
Alright so this is an odd one... I have an application built in ColdFusion
This is a bit of an odd one and was wondering if anyone had
OK this is an odd one. I wanted to install ASP.NET MVC 2 Beta

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.