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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:46:39+00:00 2026-05-26T01:46:39+00:00

I am developing web site using jQuery and other tech. I have problem in

  • 0

I am developing web site using jQuery and other tech. I have problem in selector as below.

My page contains a div with id='tblData'.
Inside #tblData I have created multiple tables with class='data'.

Inside a table (.data), i have created multiple tr and td. Some of these td have class='vis'.

I am changing display property of these td.vis dynamically from block to none as per my requirement.

When page loads I want to loop through all elements. My condition is that I want to loop through all td‘s inside table (with class='data') whose display property is not none.

I am writing following code but it doesn’t work.

$("div#tblData .data td[class='vis']").each(function (i) {  
    if ($(this).attr('display') != "none") {
        if ((i % 2) == 0) {
            $(this).removeClass("comparecontent2").removeClass("comparecontent1").addClass("comparecontent2");  
        } else {
            $(this).removeClass("comparecontent2").removeClass("comparecontent1").addClass("comparecontent1"); 
        }
    }
});  

alert($("div#tblData .data td[class='vis']").size()); // shows zero while 'alert($("div#tblData .data td").size())';
                                                      // returns right count.
  • 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-26T01:46:39+00:00Added an answer on May 26, 2026 at 1:46 am

    Use one of those two commands:

    .is(":hidden")
    .filter(":hidden")
    

    http://api.jquery.com/hidden-selector/

    e.g.

      $(this).is(":hidden")
    

    or

      $("td:hidden")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ASP.NET MVC for developing a web site. I am using jquery
I am currently developing a web site using ASP.NET 3.5. On a page there
I'm developing a mobile site using IUI . It's a framework that makes web
I'm developing a dynamic website using jQuery and I have found several jQuery plugins
I'm developing a multilingual web site and the localization is done mostly by using
I am developing an asp.net web site and I am not using inbuilt authentication
Hello everyone, I'm developing a photo sharing web site using the CodeIgniter PHP framework
I'm new to jquery and javascript, and to web site developing overall, and I'm
I'm developing a website(just for fun) and have been using mostly js/jquery to build
I am developing a site using PHP, XHTML strict, and jQuery that will be

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.