s.sort((a, b) => {
                return parseInt(a.getAttribute('data-value')) - parseInt(b.getAttribute('data-value'));
            });
        } else {
            childDivs.sort((b, a) => {
                return parseInt(a.getAttribute('data-value')) - parseInt(b.getAttribute('data-value'));
            });
        }
        currdbidxs = [];
        childDivs.forEach(child => {
            tocDiv.appendChild(child);
            currdbidxs.push(child.getAttribute('data-index'));
        });