Guest User

Guest User

  • Tech Writer
  • 75
  • 1.7k

Increment number when click.

Jun 4 2021 7:15 AM
<div class="pagination-blogpost"> How to increase this number based on record .Now it's static this number .Please help me
<nav aria-label="navigation">
<ul class="pagination">
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link" href="#">Next</a></li>
</ul>
</nav>
</div>
</section>
<script type="text/javascript">
$('.pagination li a').click(function (event) {
event.preventDefault();
var id = $(this).text();
$.ajax({
url: "/Utility/PageId?Id=" + id,
type: "POST",
dataType: "html",
traditional: true,
contentType: "application/json; charset=utf-8",
success: function (data) {
$(".blog-layout-content").html("");
$(".blog-layout-content").html(data);
},
});
});

Answers (3)