I use materialize css for my project, i have problem when i want to append option in matrialize select with ajax. I\'ve following this answer How to dynamically modify <
$(document).ready(function() {
$('select').material_select();
});
$(document).on('change','#select_1', function(){
get_selected();
})
function get_selected(){
var data=[{id:1,name:"ABC"},{id:2,name:"XYZ"},{id:3,name:"PQR"}];
var Options="";
$.each(data, function(i, val){
Options=Options+"";
});
$('#select_2').empty();
$('#select_2').append(Options);
$("#select_2").material_select()
}