success: function(data) {
console.log(data);
console.log(data[0].name);
}
Output on console:
[{"id":1,"name":"Apple"}]
undefined
Where is problem in the code? I want to use this output in tag
<option value="' + data[0].id + '"'>' + data[0].name + </option>