I have an array in javascript with the following data to be populated in a div. The array is as follows
var array1 = new array('abc','def', 'ghi', 'jkl','mno');
I want to implement pagination for a div containing a set of divs holding each with data from the specified array. that is, div 1 will contain abc, div 2 will contain def, etc ...
I send the page without a click and the maximum number of divs that will be displayed on the page for the function. I set max_num divs to display is 2. The function is as follows.
function renderPagination(pageno, max_num){ for(var i=0;i< max_num; i++){ } }
Here I need to run a loop in which a lot of divs will be populated. those. if pageno is '0', you should see abc, def divs. If pageno is "1", then div ghi, jkl should be displayed. I think, instead of i = 0, I should initialize another variable.
source share