I have small problem, I need to use button from controller to work for JavaScript in view. I pass the HTML from controller to view, but it seems like the view doesn't see the button which comes from controller. Edited: I can display the data from controller into view blade with no error, what I want to do is just to use the button of these data which passed to view in other jquery function here how I recive the data from controller in view blade using the jquery function which sent from it the url and the data
success: function (data) {
$('#cart_product').html(data);
}
controller
public function edit(Request $request,$id){
foreach($products as $Product){
echo '<input id="rowId" class="remove_this btn btn-sm btn-danger" type="submit" name="rowId">';
}
}
view blade
<script>
$(function(){
$('.remove_this').on("click", function () {
alert('test');
});
});
</script>