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

  • Home
  • SEARCH
  • 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 101845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:50:58+00:00 2026-05-11T00:50:58+00:00

I have a snippet of code that I’m working with to filter rows in

  • 0

I have a snippet of code that I’m working with to filter rows in a table. It works perfectly in every browser other than Firefox v3.0.x (works fine with 3.1 beta 2). When I run the snippet in Firefox 3.0.x, it says that children is undefined. I am using jQuery v1.2.6 also.

Code Snippet:

var bodyRows = $('#resultsTable tbody tr'); bodyRows.each(function(n){     if(!filterPattern.test($.trim(this.children[2].innerHTML))){ //errors here             this.style.display = 'none';     }     else {             this.style.display = '';     } }); 

The code selects all table rows and then loops through them, testing the innerHTML text of the 3rd column. If the RegEx test fails, the row is hidden, else it is displayed.

Has anyone seen this issue and / or know how to get it working?

Thanks

EDIT: Here is the HTML markup for the table. For brevity, I’m only giving 2 record in it though more are populated.

<table id='resultsTable' cellpadding='0' cellspacing='0'>     <thead>         <tr>             <th>First</th>                 <th>Last</th>             <th>City</th>             <th>State</th>             <th>Zip</th>             <th>Email</th>             <th>&nbsp;</th>         </tr>     </thead>         <tbody id='resultsBody'>         <tr>             <th>James</th>                 <th>Eggers</th>             <th>SomeCity</th>             <th>IA</th>             <th>55555</th>             <th>email@email.com</th>             <th>&nbsp;</th>         </tr>         <tr>             <th>John</th>                 <th>Doe</th>             <th>SomeCity</th>             <th>KY</th>             <th>88888</th>             <th>email2@email.com</th>             <th>&nbsp;</th>         </tr>     </tbody>         </table> 
  • 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. 2026-05-11T00:50:59+00:00Added an answer on May 11, 2026 at 12:50 am

    Why not use jQuery to traverse the DOM elements instead.

    var bodyRows = $('#resultsTable tbody tr'); bodyRows.each(function(){     var thirdCell = $(this).find('td').eq(2);     if(!filterPattern.test($.trim(thirdCell.html()))){         this.style.display = 'none';     } else {         this.style.display = '';     } }); 

    You could also use ‘.text()‘ if you just want the text without any possible markup to be returned.

    The property children is an IE only DOM property which no other browser has (to my knowledge). Firefox uses the standard property childNodes for accessing children. The problem with childNodes is that it considers whitespace and text to be a node (or at least Firebug says so) which makes it (in my opinion) very difficult to deal with. If you have a JavaScript API, you should take advantage of it so that you don’t have to deal with the differences between browsers’ DOM traversal techniques.

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

Sidebar

Related Questions

I have the following snippet of code that's generating the Use new keyword if
We have a project that generates a code snippet that can be used on
I have a code snippet written in PHP that pulls a block of text
I have a table defined (see code snippet below). How can I add a
I have a snippet of code that writes the data alphabetically from a database
I have a snippet of code that I'm calling from a service: context.registerReceiver(new BroadcastReceiver()
I have a snippet of code that looks like this: double Δt = lastPollTime
I have a snippet of code that should remove a text file and its'
I have a snippet of code that I thought would work because of closures;
i have this snippet of code that use an iterator on a list for

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.