-1

I added the following table row using jQuery AJAX:

<td>
  <button class="btn btn-mini btn-primary" id="increment"></button>
</td>

The problem is that I can't match this created button after this:

$("#increment").click(function () {
    console.log("Clicked!");
})

I tried the live() function but seems to be deprecated. Thanks in advance.

4

1 回答 1

1
$('table').on('click', "#increment", function() {
    console.log("Clicked!");
})
于 2013-03-30T22:06:59.760 回答