For some reason, it is impossible to find the element by id for the html block that is generated and comes from the server via an Ajax request. The select box appears in the browser, but $("#test").on('change', function() does not see it.
It is noteworthy that when using this code without Ajax on the html page, everything works. Help, please understand what the problem is.
$("#test").on('change', function() { b = $(this).val(); console.log(b); }); <select id="test"> <option>Выберите значение</option> <option value="1">Первый элемент</option> <option value="2">Второй элемент</option> </select>
$('body').on('change', '#test', function() {});- MasterAlex