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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:25:51+00:00 2026-05-31T18:25:51+00:00

This code stopped working when we upgraded to jQuery 1.7.1. $(‘table.className > tr’).length is

  • 0

This code stopped working when we upgraded to jQuery 1.7.1. $('table.className > tr').length is returning 0. Can you tell me how to correct it?

.NET code (executes jQuery code):

public static long GetTableRowCountByCssClass(IWebDriver driver, string cssClass, int exclusionRowCount)
{
    IJavaScriptExecutor js = driver as IJavaScriptExecutor;
    long count = (long)js.ExecuteScript("return $('table." + cssClass + " > tr').length");
    if (count != 0)
    {
        count = count - exclusionRowCount;
    }
    return count;
}

HTML code:

<!-- Products -->
<table class="cart" cellpadding="0" cellspacing="0" border="0">

    <thead>
        <tr>
            <th class="remove">Delete</th>
            <th class="prod-desc">Product Description</th>
            <th class="ships_w">Ships Within</th>
            <th class="price">Unit Price</th>
            <th>&nbsp;</th>
            <th class="quantity">Qty.</th>
            <th class="totals">Total</th>
        </tr>
    </thead>

    <tfoot>
        <tr>
            <td id="subtotal" class="order_summary_label" colspan="6" >Sub Total: </td>
            <td id="subtotal_number" class="order_summary_value">$124.89</td>
        </tr>
        <tr>
            <td id="cart-total-label" class="order_summary_label" colspan="6" >Total: </td>
            <td id="cart-total" class="order_summary_value"><strong>$124.89</strong></td>
        </tr>
    </tfoot>

    <tbody>

        <tr class="alt">

            <td class="remove">
                <input class="checkIt" type="checkbox" name="remove[variation][208]" id="remove_208_variation" value="0"  />
            </td>

            <td class="prod-desc">
            <div class="imgThmb">
            <a href="/product/water-gel" title="Water Gel - Magic Slush Powder - Water Gel 100 gram Jar">
            <img src="/img/cache/product/WSPA_500_140_64.jpg" alt="Water Gel - Magic Slush Powder - Water Gel 100 gram Jar" />
            </a>
            </div>

                <a href="/staging/product/water-gel" title="Water Gel - Magic Slush Powder - Water Gel 100 gram Jar" class="clean">
                    Water Gel - Magic Slush Powder - Water Gel 100 gram Jar                                                     
                </a>
            </td>

            <td class="ships_w">
            </td>

            <td class="price">$6.99</td>

            <td class="discount">
            </td>

            <td class="quantity">
                <input type="text" class="quantity_box quantity" name="quantities[variation][208]" id="quantity_variation_208" value="5" maxlength="4" />
            </td>

            <td class="totals"><strong>$34.95</strong></td>

        </tr>

        <tr >

            <td class="remove">
                <input class="checkIt" type="checkbox" name="remove[variation][1118]" id="remove_1118_variation" value="0"  />
            </td>

            <td class="prod-desc">
            <div class="imgThmb">
            <a href="/product/flying-film-canisters" title="Flying Film Canisters Kit - Flying Film Canisters Activity Kit">
            <img src="/img/cache/product/film_canister_launcher_2011011240_64.jpg" alt="Flying Film Canisters Kit - Flying Film Canisters Activity Kit" />
            </a>
            </div>

            <a href="/product/flying-film-canisters" title="Flying Film Canisters Kit - Flying Film Canisters Activity Kit" class="clean">
            Flying Film Canisters Kit - Flying Film Canisters Activity Kit                                                      
            </a>
            </td>

            <td class="ships_w">
            </td>

            <td class="price">$14.99</td>

            <td class="discount">
            </td>

            <td class="quantity">
                <input type="text" class="quantity_box quantity" name="quantities[variation][1118]" id="quantity_variation_1118" value="6" maxlength="4" />
            </td>

            <td class="totals"><strong>$89.94</strong></td>

        </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. Editorial Team
    Editorial Team
    2026-05-31T18:25:52+00:00Added an answer on May 31, 2026 at 6:25 pm

    The problem is that the tr is not, and cannot be, a direct child of the table element. It’s a child of the tbody element that’s automatically placed in the table by the browser if it’s not put there by the author of the page.

    If you try, instead: $('table.className > tbody > tr').length it should work.

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

Sidebar

Related Questions

This code was working and when we upgraded to php 5.3.10 it stopped working
this code was just working! but for some reason it stopped to work now.
I am trying to insert a record. This code worked but has stopped working
This Code: Something = new Guid() is returning: 00000000-0000-0000-0000-000000000000 all the time and I
this code is correct?? String note = text.txt; FileWriter file = new FileWriter(note); Scanner
Some code a production server which uploaded files has seemingly stopped working with the
I have this code to restart a service, but this is not working. I
i have the following code which stopped working recently. The problem is that no
For some reason, Eclipse's code assist stopped working for variables that are assigned objects.
This isn't my code, I'm just troubleshooting it. Some code that has been working

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.