So I have tried to create a button from php that will be displayed in html and I tried to test the button by creating alert function but it doesn't work while if I create button in html directly the function works. Here is my code, which may not be clear, but I hope it helps with the understanding of my question. Thanks.
<?php
echo"<div class='col-md-3'>";
echo"<p><button id='remove'>remove</button></p>";
?>
$(document).ready(function(){
$("#remove").click(function(){
alert("test");
});
});