I am currently working on paginating a section.
The pagination is functioning properly, but I would like to know if it is possible to reset the pagination dynamically based on the number received from an input
using jQuery
.
For example:
In my current pagination setup, it displays numbers like 1 2 3
.
Now, let's say I receive the number 100
.
At this point, the pagination section should reset to 100
, with 100
being the active element and the sequential numbers appearing as 100 101 102
.
If 101 happens to be the last page, then it should highlight 100 as the active number and 101 as the last one.
Similarly, if I enter 50, the pagination section should reset to show numbers like 50, 51, 52 with 50 being highlighted.
I have been attempting to implement this functionality in my code snippet below.
Firstly, how can the pagination detect that a number has been entered into the input text field (as per the alert message written in JavaScript)?
Any advice or suggestions are greatly appreciated.