In my page, I use this block of code to generate HTML:
$.ajax({
url: '...'
}).done(function (model) {
for (var i = 1; i <= model.numberOfPages; i++) {
html += '<a class="page_number" href="javascript:void(0);">'+i+'</a> ';
}
$(".page_numbers").html(html);
});
But when I try to add a click event on these a tags, nothing happen. Where did I go wrong?
$(document).ready(function (event) {
$('.page_number').click(function (event) {
//Some code here
});
});