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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:36:07+00:00 2026-05-27T07:36:07+00:00

I unfortunately do not have the choice of using a different browser. I have

  • 0

I unfortunately do not have the choice of using a different browser.

I have the following code running against some HTML. The problem, I think, is line 4. Internet Explorer 7 doesn’t do anything at all when I click the row with id “yellowOne” (or any other row). If I take out .is('tr.grayheading') than IE opens all the rows with the yellowX class. However, I only want those that have both that yellowX class AND the grayheading class.

function showTheGray($yellowSection) {  
    $theYellowClass = 'yellow' + $yellowSection;
    if ($($theYellowClass).is(':hidden')) {       
        $($theYellowClass).is('tr.grayheading').show('normal');     
    }  else { $($theYellowClass).hide('normal'); }
} 

$(document).ready(  function() {    
    $('tr#yellowHeadOne').click(       
        function($e) {         
            showTheGray('One');       
        }     
    );    
    $('tr#yellowHeadTwo').click(       
        function($e) {         
            showTheGray('Two');       
        }     
    );    
    $('tr#yellowHeadThree').click(       
        function($e) {         
            showTheGray('Three');       
        }     
    );  
});

Does IE7 have problems with multiple classes being assigned an element? ie, class="yellowOne grayheading"
Have I written out my selectors wrong?

Does IE7 not like .is()? (I ask because the line $($theYellowClass).is(':hidden').show('normal') threw an error, hence my switching to the if block)

  • 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-27T07:36:07+00:00Added an answer on May 27, 2026 at 7:36 am

    you got some other problems mate. your selector for yellow isn’t correct. try this code, putting your showthegrey function after document ready for best practices. generally, when you have a variable that starts with a $, that means it is a jquery element. I think changing some of your variable names might help you see whats going on more clearly. also, you should use “var” to declare your variables within the scope of that function. since you didn’t show your HTML, it isn’t clear if you have more than one “yellow” element which you want to be affected on the page or what you want to be affected, but I’m going to assume you just have one. also, I just realized I have no idea what you are trying to do.

    also, when you use an id, you don’t need to narrow it down with something like tr in front of it, as this will actually slow down your selection. since ids are unique, you don’t need to nawrrow it down to a specific element on the page.

    one thing you should notice is that .is() should be applied to one element, and it returns a true or false only. so your application of it to tr:grayheading will just plain not work. I think what you are looking for in that situation is either the function find(‘yourSelector’), which will select all the elements within the one you are searching for that meet yourSelector, or hasClass, which i implemented below:

    $(document).ready(  function() {    
        $('#yellowHeadOne').click(       
            function($e) {         
                showTheGray('One');       
            }     
        );    
        $('#yellowHeadTwo').click(       
            function($e) {         
                showTheGray('Two');       
            }     
        );    
        $('#yellowHeadThree').click(       
            function($e) {         
                showTheGray('Three');       
            }     
        );  
    });
    
    
    function showTheGray(yellowSection) {  
        var theYellowClass = 'yellow' + yellowSection;
        var $theYellowElement = $('.' + theYellowClass);
    
        if ($theYellowElement.is(':hidden') && $theYellowElement.hasClass('grayheading')) {       
            $theYellowElement.show('normal');     
        }  
        else { 
            $theYellowElement.hide('normal'); 
        }
    } 
    

    so I’m not sure if this is what you want at all, but hopefully it will help show you where you might need to make changes. What this code will do for example when you click on yellowHeadTwo, it will select the element with class yellowTwo, check to see if it is hidden, and if it is and it has the class grayheading, then it will show, otherwise it will be hidden.

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

Sidebar

Related Questions

I've got some code which works fine in IE but unfortunately not in Google
Unfortunately we do not have the required DCOM access to the SQL Server mentioned
In my application, a user has_many tickets. Unfortunately, the tickets table does not have
I know that XSLT does not work in procedural terms, but unfortunately I have
We're using WatiN for testing our UI, but one page (which is unfortunately not
Here's a wierd one. I'm reusing a code base that unfortunately must not be
Unfortunately, the problem is not more specific than that. I've found a few examples
Problem: I have to support users who need to edit web pages. Some of
Unfortunately I am not writing this question from my Developing PC so I might
Unfortunately the specification does not tell anything about precision. The xml scheme definition states

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.