var hash = window.location.hash.substring(1);
console.log(hash);
var $findOption = $('.js-select-hash').children().filter(function () {
console.log($(this).text() === hash);
return $(this).text() === hash;
});
if ($findOption.length) {
var $select = $findOption.parent();
$select.val(hash);
$select.trigger('change');
}
let hash = window.location.hash.substring(1);
// перевод хэша
let decode = decodeURI(hash);
var $findOption = $('.js-select-hash').children().filter(function () {
return $(this).text().trim() === decode;
});
if ($findOption.length) {
var $select = $findOption.parent();
$select.val(decode);
$select.trigger('change');
}
$('#mySelect2').val('1'); // Select the option with a value of '1'
$('#mySelect2').trigger('change'); // Notify any JS components that the value changed