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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:06:28+00:00 2026-06-15T18:06:28+00:00

I would like to know if it is possible to use eq() with filter().

  • 0

I would like to know if it is possible to use eq() with filter(). I’ve already tested it and to no avail, though I’ve found a work around. I was just wondering in case I missed something.

My example is this…
Say you have a few tables with columns and rows.

<table class="menuTable"><tr><td>1</td><td>2</td></tr></table>
<table class="menuTable"><tr><td>3</td><td>4</td></tr></table>

I would like to find how many column spaces are in each table, so…

<script type="text/javascript">
alert($(".menuTable").eq(0).filter("td").length);
alert($(".menuTable").eq(1).filter("td").length);
</script>

This doesn’t work and I’d like to find out why. I ended up using .find() instead of .filter(), but I think it would be more appropriate to use .filter().

Thanks for any input.

After a few comments I realize my problem is in the difference between find and filter. Also… for those who are curious. I did manage to get it to work using filter by including eq in the selector…

alert($(".menuTable:eq(0)").filter("td").length);
  • 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-15T18:06:29+00:00Added an answer on June 15, 2026 at 6:06 pm

    I ended up using .find() instead of .filter(), but I think it would be
    more appropriate to use .filter().

    find is indeed what you should be using here. filter as the name suggests, filters the collection of elements, in your case that collection is all .menuTable elements; there are no tds in that collection. find on the other hand looks for children elements, and your collection does have td children elements.

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

Sidebar

Related Questions

I would like to know: If it's possible to use Lazarus (Pascal) for both
I would like to know if it is possible to use canvases and javascript
I would like to know how or if it is possible to use selectors
I would like to know how is it possible to use a free C++
I would like to know how is possible to read a file placed in
I would like to know if its possible to write a nested select statment?
I would like to know if its possible to clear the current information stored
I would like to know is it possible to add css to one of
Hi I would like to know if its possible to do something similar to
I would like to know if the following is possible in any of the

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.