Submitted about 2 years ago
eventlisteners were used, backticks, createelement,
@NoraTailor
Design comparison
SolutionDesign
Community feedback
- @AdrianoEscarabotePosted about 2 years ago
Hi Nóra Szabó, how are you? I really liked the result of your project, but I have some tips that I think you will enjoy:
To make the submit button work only when the user selects a number, do this:
btn.addEventListener('click', () => { btn.classList.add('selected') let valueBtn = btn.value; const h3 = document.createElement('h3'); const div = document.getElementById('thankyou') h3.innerHTML = `You selected ${valueBtn} out of 5`; div.prepend(h3); submitBtn.addEventListener('click', () => { thankYouPage.style.display = 'block'; firstPage.style.display = 'none'; }); });
The rest is great!
I hope it helps... 👍
Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord