Hello, tell me, please, what is my joint. Here is a test page . There is a choice of car. After selecting a brand, a model selection is shown. In theory, after choosing a model, the choice of the year should be shown, but for some reason the year remains disabled. Why is this happening?
Here is the code:
function selectAuto(classSelect, pathJson, firstOption) { $('select.' + classSelect).find('option').remove(); $('select.' + classSelect).append( "<option>" + firstOption + "</option>" ); $.getJSON(pathJson, function (data) { $.each( data, function( key, val ) { $('select.' + classSelect).append( "<option>" + val + "</option>" ); }); }); setTimeout(function() { $('.tire-selection-select.' + classSelect).attr('disabled', false).trigger('refresh'); }, 100) }; $('.jq-selectbox.select-mark .jq-selectbox__dropdown li:not(:first-child)').on('click', function(){ selectAuto('select-model', 'js/json/models.json', 'Модель'); }); $('.jqselect.select-model li:not(:first-child)').on('click', function(){ selectAuto('select-year', 'js/json/year.json', 'Год'); });