Bug Tracker

Modify

Ticket #8003 (closed bug: duplicate)

Opened 2 years ago

Last modified 2 years ago

Child selector followed by ancestor selector not working in IE

Reported by: jacob.h.page@… Owned by:
Priority: high Milestone: 1.next
Component: selector Version: 1.4.4
Keywords: Cc:
Blocking: Blocked by:

Description

Given the following HTML and JavaScript:

    <html>
      <head>
        <script type="text/javascript" src="jquery.min.js"></script>
        <script type="text/javascript">
          $(document).ready(function() {
            $('.a > div a').text("Found!");
          });
        </script>
      </head>
      <body>
        <div class="a">
          <div>
            <a href="#">Not Found</a>
            <div>
              <a href="#">Not Found</a>
            </div>
          </div>
        </div>
      </body>
    </html>

I would expect that both hyperlinks' text would change. In Chrome and Firefox, they do, but in IE 8 at least, only the first hyperlink changes. It appears as though ancestor selectors do not work properly after a child selector has been encountered.

Change History

comment:1 Changed 2 years ago by jitter

  • Priority changed from undecided to high
  • Resolution set to duplicate
  • Status changed from new to closed
  • Component changed from unfiled to selector

Thanks for taking the time to contribute to the jQuery project by writing a bug report and providing a test case!

I identified this to be a known issue. Check the ticket mentioned below for progress on this issue.

comment:2 Changed 2 years ago by jitter

Duplicate of #4344.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.