Drill 15: Find the core line — Forms without a reload
Point to the line that does the main work and explain why.
What you will be able to do
- Point to the line that does the main work and explain why.
Practice task
Point to the line that does the main work and explain why.
form.addEventListener('submit', async (event) => {
event.preventDefault()
const button = form.querySelector('button')
button.disabled = true
try {
const response = await fetch('/api/signup', { method: 'POST', body: new FormData(form) })
if (!response.ok) throw new Error('Save failed')
} finally {
button.disabled = false
}
})Your turn
EasyWrite your answer
Point to the line that does the main work and explain why.
TEXT · starter
Your answer…Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.