I\'ve run into a problem where I have a select tag that the user would use to select a brand of phone and the page using jquery would then just display those phones.
<
I think I have more simple solution. Why not to set the select back to index 0 when document is ready? It could look like this:
$('.manufacturers').prop('selectedIndex',0);
So your script could look like this:
$(document).ready(function() {
$('.manufacturers').prop('selectedIndex',0);
$('.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());
}
});
});
And after reload the select will be back to the first position.