I want show data in select drop down with jquery ajax. This my code :
$(document).ready(function() {
$(".inventaris").on('change',function(e) {
console.log(e);
var cat_id = e.target.value;
$.get('/get-id/' + cat_id , function(data){
$.each(data, function(index, obj){
console.log(obj);
});
});
});
});
The result is :
[{id: 1, tgl_pinjam: "2018-06-10"},{id: 2, tgl_pinjam: "2018-06-11"}]
How to get?
["2018-06-10","2018-06-11"]