scrimba
Code with AI
Build with ChatGPT
Interactive event invite - part 2
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Interactive event invite - part 2
AboutCommentsNotes
Interactive event invite - part 2
Expand for more info
script.js
run
preview
console
// Get the form element and confirmation message element
const rsvpForm = document.getElementById('rsvp-form');
const confirmationMessage = document.getElementById('confirmation-message');

// Add event listener to the form submission
rsvpForm.addEventListener('submit', (event) => {
event.preventDefault(); // Prevent form submission

// Get the selected attendance value
const attendance = document.getElementById('attendance').value;

// Display confirmation message based on attendance selection
if (attendance === 'yes') {
confirmationMessage.innerHTML = '🎉 Party on! We look forward to seeing you at the GIF Gala!';
}

// Show the confirmation message
confirmationMessage.style.display = 'block';

// Reset the form
rsvpForm.reset();
});
Console
/index.html
-6:53