Modify ↓
Ticket #6111 (closed bug: invalid)
find() found a wrong number of tags using IE7
| Reported by: | SBuzzi | Owned by: | |
|---|---|---|---|
| Priority: | Milestone: | 1.4.2 | |
| Component: | selector | Version: | 1.4.1 |
| Keywords: | IE7 find wrong count of tags | Cc: | |
| Blocking: | Blocked by: |
Description
Hi, when I try to use this test code <div class="matrixSetup">R <input value="3" ></input> - C <input value="3" ></input> <a href="#" onclick="alert ($(this).parent().find(':input').size());">Modify</a></div> the alert box shows 4 elements in IE7, only to elements in Chrome 4.0 and in Firefox 3.6. I found a workaround based on the use of contract tag syntax <input />
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

You cannot use the </input> tag in HTML4, the tag is always assumed to have no children and be self closing, even if you don't use <tag /> syntax. So jQuery is just finding the markup as interpreted by the browser. Even if your document was XHTML it wouldn't matter since IE doesn't support XHTML and will interpret the document as HTML.