When creating elements dynamically, pagination does not work, in the code I used bootstrap pagination
Question: how to initialize elements in DOM ?
The algorithm when you click the "add" button is added to the row in the table.
If the table is static html then there is pagination with numbering (it works fine), but in my case the rows in the table are added dynamically by pressing a button and in this case there is no numbering, that is, the elements that did not exist in the DOM from the very beginning of the script (see the link under item 2, it is also present in my code) for the table does not see them of these elements
document.querySelector('#createD').onclick = function() { var htb = document.getElementById('htb'); var row = document.createElement("div"); row.className = "t-row"; row.innerHTML = "<div class='col-1'><input class='checkbox' type='checkbox' name='domename'></div>" + "<div class='col-2'><div><i class='site-ico'></i><a href='#' class='domen-name'>www.example</a></div></div>"; tba.insertBefore(row, null); }, document.querySelector('#removeD').onclick = function() { var row = document.getElementsByClassName('t-row'); var domename = document.getElementsByName('domename'); for (i = 0; i < domename.length; i++) { if (domename[i].checked) { var remElm = domename[i]; var tba = document.getElementById("tba"); remElm.parentNode.removeChild(remElm); tba.removeChild(row[i]); } } }