//Developed by Brett let mobileCheck = () => { if (window.innerWidth <= 768) { return true } else { return false } } const buildLinks = () =>{ var menuItems = Array.from(document.querySelectorAll('#mainNav .dropdown-menu a')) var topLinks = menuItems.filter(x=>x.textContent === 'TopLink') topLinks.forEach(x=>{ var topLink = x.closest('.dropdown-menu').previousElementSibling topLink.addEventListener('click',function(){ if(mobileCheck()){ return }else{} window.location = x.href }) x.parentElement.remove() }) } buildLinks()