Answer the question
In order to leave comments, you need to log in
Chrome and reset select via jQuery
There is a line written in jQuery:
$('#styleGallery option:selected').removeAttr('selected');
Which should reset the selection in the select element.
In FF, everything works with a bang, and after the line is executed, the first element in the list becomes active.
In Chrome, select is reset. And the “empty line” becomes active, which chrome itself adds to the select element.
What is the right way to make it possible to “reset” the selection of the select element in both rows?
Answer the question
In order to leave comments, you need to log in
Not sure , but try:
$('#styleGallery option:first').attr('selected','selected');
For a select with a data-filter class, it would look like this:
$('select.data-filter').prop('selectedIndex',0);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question