document.addEventListener('DOMContentLoaded', () => {
// Find all h3 headers on the page
const headers = document.querySelectorAll('h3');
headers.forEach(header => {
if (header.textContent.trim() === 'Additional membership details') {
// Create a new paragraph element with the teaser text
const teaser = document.createElement('p');
teaser.textContent = 'Better wellness begins with better understanding. Get the full story on membership below.';
// Insert the new paragraph immediately after the header
header.insertAdjacentElement('afterend', teaser);
// Find the nearest parent div with the class "inner"
const parentInner = header.closest('.inner');
if (parentInner) {
// Look for the next div with class "me-3up--grid" within the parent
const gridDiv = parentInner.querySelector('.me-3up--grid');
if (gridDiv) {
// Hide the "me-3up--grid" div
gridDiv.style.display = 'none';
} else {
console.log('No .me-3up--grid div found within the parent .inner');
}
} else {
console.log('No parent .inner found for this h3');
}
}
});
// Find all links on the page
const links = document.querySelectorAll('a');
links.forEach(link => {
const linkText = link.textContent.trim();
if (
(linkText === 'Get in touch' || linkText === 'Get in touch about membership') &&
!link.classList.contains('launch-membership-cta')
) {
// Add the class if the text matches and the class isn't already present
link.classList.add('launch-membership-cta');
// Change href to #
link.setAttribute('href', '#');
}
});
});