Bug Tracker

Opened 8 years ago

Closed 8 years ago

#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:
Blocked by: Blocking:

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 (3)

comment:1 Changed 8 years ago by bobholt

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
});

comment:2 Changed 8 years ago by anonymous

Yep, sorry. I did the same with this code and it worked in IE. I must be having some other issue but jumped to this conclusion without checking properly.

find is all good...

comment:3 Changed 8 years ago by timmywil

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.