JS_LISTENER = """ function() { document.addEventListener('click', function(e) { // 1. Use .closest() to find the tag even if user clicks the text/icon inside it const target = e.target.closest('a.appointment-btn'); if (target) { // 2. Prevent the link from opening in a new tab/window e.preventDefault(); // 3. Get the URL from the standard href attribute const url = target.getAttribute('href'); const container = document.getElementById('consultation-iframe-container'); if (container) { container.innerHTML = `
Appointment Booking
`; container.scrollIntoView({ behavior: 'smooth' }); } } }); } """ JS_CLEAR = """ function() { const el = document.getElementById('consultation-iframe-container'); if (el) { el.innerHTML = ''; } } """