I had a problem when I have a select tag that the user will use to select the phone brand, and the page using jquery will then display these phones.
Thanks to helping people overflow the stack, this works great in every browser, but firefox. For some reason, when I refresh the page, the select tag shows the last option selected, but the page displays all available phones. Does anyone have any suggestions or tips on getting firefox to update the select tag? I can not show this on js.fiddle because this does not happen, so here is the link:
http://davidarabis.com/test/test.html
And here is the code:
<select class="manufacturers">
<option class="selected" value="all">All</option>
<option value="motorola">Motorola</option>
<option value="htc">HTC</option>
<option value="lg">LG</option>
<option value="samsung">Samsung</option>
<option value="kyocera">Kyocera</option>
</select>
<div class="scroll-content">
<ul class="manulist motorola">
<li><a href="#">Motorola Triumph</a></li>
</ul>
<ul class="manulist htc">
<li><a href="#">HTC WILDFIRE S</a></li>
</ul>
<ul class="manulist lg">
<li><a href="#">LG Optimus Slider</a></li>
<li><a href="#">LG Optimus V</a></li>
<li><a href="#">LG Rumor Touch</a></li>
<li><a href="#">LG Rumor 2</a></li>
<li><a href="#">LG 101</a></li>
</ul>
<ul class="manulist samsung">
<li><a href="#">Samsung Intercept</a></li>
<li><a href="#">Samsung Restore</a></li>
<li><a href="#">Samsung M575</a></li>
</ul>
</div>
jQuery:
$(document).ready(function() {
$('.manufacturers').change(function() {
var selected = $(this).find(':selected');
$('ul.manulist').hide();
if ($(this).val() == 'all') {
$('.scroll-content ul').show();
} else {
$('.' + selected.val()).show();
$('.optionvalue').html(selected.html()).attr(
'class', 'optionvalue ' + selected.val());
}
});
});
Thanks in advance for any advice or help.