Please help me, my ajax don't print any output but when i used alert() to print the output it shows the output.
$(".grp-ans").each(function(e){
$.ajax({
type: 'POST',
url: 'show-answer.php',
data: {
'p_id': $(this).attr('id')
},
success: function(data){
$(this).text(data);
},error: function(msg){
$(this).text("error");
}
});
});