-1
jqueryとテーブルの間に何が起こっているか説明できますか?Jquery/Javascript:要素がテーブル内にある場合、jqueryのセレクタが機能していません。
<table class="table table-responsive" id="student-table">
<thead>
<tr>
<th>Name</th>
<th>Age</th>
<th>Address</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="student in students">
<td>{{student.firstname}}</td>
<td>{{student.age}}</td>
<td>{{student.address}}</td>
<td><button class="btn btn-danger" id="delete-button" > Delete </button></td>
</tr>
</tbody>
私のjavascriptのコードは次のとおりです:上記のこのコードは動作しません
$('#delete-button').on('click', function() {
console.log('delete btn clicked!');
});
しかし、私は表の外に私の削除BTNを入れた場合、ボタンは現在応答している私はここのコードを持っています私はそれをクリックします。それはどうやって起こるのですか?
OMGのdidntは今では感謝:) –