In an ajax on success function I am receiving some value and I want to pass that value into a div
here is the div in blade view where I want to pass value
<div id = "demo">
</div>
here is my javascript code where I am receiving values
success: function (data) {
var getsellerreport = data.getsellerreport;
var output = '<tbody>
@foreach($getsellerreport as $preport)
<tr>
<td>{{ $preport['product_id'] }}</td>
</tr>
@endforeach
</tbody>';
document.getElementById("demo").innerHTML = output;
}
According to this code I am using output= 'html' to store html and trying to pass output in demo but it is not working.
Can someone help me? how can I pass html from script to blade view?