[jQuery] list insert out of order
IE7/8 and Safari, but not FF are showing dropdown menu items out of
alphabetical order when they're pulled in to a separate div, does
anybody have any hints as to how it could be put into order
Here's the current HTML:
<div class="fill_container">
<div class="fill_me"></div><!-- .fill_me -->
</div><!-- .fill_container -->
<select id="select">
<option class="btext_1" value="1">btext 1</option>
<option class="atext_2" value="2">atext 2</option>
<option class="ctext_3" value="3">ctext 3</option>
</select>
Here's the current JS:
$(document).ready(function(){
$("#select option").each(function(){
var itemClass = $(this).text();
$('.fill_me').append('<a href="#"><img src="' + itemClass + '.gif"
class="' + itemClass + '" alt="' + itemClass + '" /></a>');
});
});
Here's the goal generated HTML:
<div class="fill_container">
<div class="fill_me">
<a href="#"><img src="atext_2.gif" class="atext_2"
alt="atext_2" /></a>
<a href="#"><img src="btext_1.gif" class="btext_1"
alt="btext_1" /></a>
<a href="#"><img src="ctext_3.gif" class="ctext_3"
alt="ctext_3" /></a>
</div><!-- .fill_me -->
</div><!-- .fill_container -->