Bro, I feel your pain. Page reloads are the worst.
Are you sure it’s not a form submission? Sometimes a `<button>` inside a `<form>` will trigger a page reload even if you don’t want it to.
Add `type="button"` to your button or use `e.preventDefault()` on the form’s submit event.
Also, check out MDN’s docs on event handling—super helpful for this stuff.
Are you sure it’s not a form submission? Sometimes a `<button>` inside a `<form>` will trigger a page reload even if you don’t want it to.
Add `type="button"` to your button or use `e.preventDefault()` on the form’s submit event.
Also, check out MDN’s docs on event handling—super helpful for this stuff.
