I want to show in my teacher variable data in the value the teacher's id, and in between the tags Name and surname I let you capture my console and my code. - > male teacher = '';
What's in my Console
My java script code
$(function() {
$( '#select_profesor' ).on('change',onprofesorchange);
});
function onprofesorchange () {
var id= $(this).val();
$.get('/api/asignar-profesor/'+id+'/profesor', function(datos) {
console.log(datos);
var profesor='<span class="btn btn-success btn-xs" value=""> </span>';
$('#div1').html(profesor);
});