So the honest truth is that I don’t even know what terms I’d search for to get a reasonably targeted search result for this, so I thought I’d hope for a quick response here. The searches I’ve tried (including SO’s related questions) haven’t mentioned this particular issue.
Every browser in my arsenal understands the following jQuery selector and alerts the proper length (2):
alert( jQuery('#course-contents.course-sidebar .folder').length );
But not IE7. It tells me there are zero. On the other hand, this:
alert( jQuery('.course-sidebar .folder').length );
Gives me a result of 2 in both places. What is it about the combination that is giving IE7 fits? Both components are necessary in some places, so I don’t want to just change it. If my syntax is wonky, I’d like to know why.
Thanks.
It is a documented IE6/7 bug (again…), as @Peter suggested.
For a workaround, you might use
or (using context, less readable)