Could someone tell me why this block of code only works after refreshing the page?
var count = 0;
$( document ).ready(function() {
// alert("testando bloco");
$("#select_n").attr('id', 'select_' + count);
$("#add").click(function(){
count ++;
// desnecessario
$("#select_n").attr('id', 'select_' + count);
//$("#filtro_subdisciplinas_select").attr('id', 'subdisciplinas_select_' + count);
$("#subdisciplina_select_n").attr('id', 'subdisciplina_select_' + count);
//$("#carro_div_n").attr('id', 'carro_div_' + carro_temp);
});
});