
Design comparison
SolutionDesign
Solution retrospective
Had a blast making this project. Any feedback would be nice. Thank you!
UPDATE:
form.addEventListener('submit', (e) => {
e.preventDefault();
validateInputs();
const successful = document.querySelectorAll('.success')
// to submit the form
if (successful.length === 4) {
form.submit();
// stop refreshing so I can change the DOM
thanksPage.innerHTML =
`<div class="wrapper form-section">
<div class="thanks-page">
<img src="./images/icon-complete.svg" alt="">
<h1>Thank you!</h1>
<p>We've added your card details</p>
<button>Continue</button>
</div>
</div>`
} })
How can i stop the form.submit() from refreshing? So that i can change the DOM
Community feedback
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