Bug Tracker

Modify

Ticket #10492 (closed bug: invalid)

Opened 20 months ago

Last modified 19 months ago

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

comment:1 Changed 20 months 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 20 months 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 19 months ago by timmywil

  • Status changed from new to closed
  • Resolution set to invalid

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.