var escolas = ["UFSCAR", "USP"];
//var alunos = [];
$(document).ready(function() {
escolas.forEach(function(item) {
$('select.lista-escola').append('<option>' + item + '</option>');
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>Escola:<selectclass="lista-escola" name="escola"></select>
Aluno: <select class="lista-aluno" name="aluno"></select>
I saw some Questions that deal with the same subject, like this: Select Option with Filters
However, my menu works in a more "dynamic" way, it is "populated" in JS itself. And that left me with more difficulty modeling a solution.
How can I make sure that, when the "UFSCAR" option is selected, for example, select
of students in the respective school is shown?