Which fix removes the bug?
const el = document.getElementById('save');
el.addEventListener('click', handleSave());
- Pass the function, not a call
- Wrap the handler in async
- Use onclick instead
- Query with querySelector
The parentheses invoke handleSave immediately and register its return value as the listener.
Play Problem Solving ▸