Modify ↓
Ticket #10492 (closed bug: invalid)
find(".class") behaves different in IE / Moz when element has more than one class
| Reported by: | clive@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.6.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
<div id="parent">
<select class="classone classtwo">
<option value="1" selected>one</option> <option value="2">two</option>
</select>
</div>
<script type="text/javascipt">
alert ($("#parent").find(".classtwo").val()); works in Chrome but not in IE.
</script>
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.

Could this be a problem with alert()? Or perhaps running your script before document ready?
I created a small test page ( http://bobholt.me/10492.html) and got the expected result in IEs 9, 8, 7, and 6 as long as I wrote it to the page and didn't use alert().
This code on my test page seems to work:
$(function(){ $('#result1').html( $("#parent").find(".classone").val() ); // 1 $('#result2').html( $("#parent").find(".classtwo").val() ); // 1 });