I have the following code in html:
<table class="table table-striped">
<thead class="inner">
<tr>
<th>Name</th>
<th>Parent</th>
<th>Priority</th>
<th>Action</th>
</tr>
</thead>
<tbody id="check">
<tr>
<td><a href="">test</a></td>
<td>null</td>
<td>0</td>
<td>
<button value="3" type="button" class="btn btn-danger btn-sm"><i class="fa fa-trash-o"></i></button>
</td>
</tr>
<tr>
<td><a href="">Lifestyle</a></td>
<td>null</td>
<td>1</td>
<td>
<button value="2" type="button" class="btn btn-danger btn-sm"><i class="fa fa-trash-o"></i></button>
</td>
</tr>
<tr>
<td><a href="">Travel</a></td>
<td>null</td>
<td>1</td>
<td>
<button value="1" type="button" class="btn btn-danger btn-sm"><i class="fa fa-trash-o"></i></button>
</td>
</tr>
</tbody>
And I have the following code in the footer:
$("#check tr td button").click(function () {
alert('here');
});
But the event does not seems to work. Why is my code not working? The data in table are created after a ajax call. Is it because of ajax?