let box = document.querySelector('.center-box'); if(box) box.before(center_block); else document.body.append(center_block);