document.addEventListener('DOMContentLoaded', function () { // Get the contact element by its ID var contactElement = document.getElementById('contact'); // Check if the contact element exists if (contactElement) { // Scroll to the contact element with smooth behavior contactElement.scrollIntoView({ behavior: 'smooth' }); } });