document.addEventListener('DOMContentLoaded', function() { const ulElement = document.querySelector('ul.social-links.flex-col'); const socialDiv = ulElement.querySelector('.social-links.flex'); const h3Element = ulElement.querySelector('h3'); // Create new parent li const wrapperLi = document.createElement('li'); // Move elements into the new li wrapperLi.appendChild(h3Element); wrapperLi.appendChild(socialDiv); // Clear the ul and add wrapped content ulElement.innerHTML = ''; ulElement.appendChild(wrapperLi); }); //..........