Problem with DOM button causing site to reload

I’m not sure if the button click is the source but when I submit the numbers the result would dissapear nearly instantly and then dissapear because of the site reloading. I want a result to show up at the output class. I

Codepen Link to full code. (Uses a bit Bootstrap)

1 Like

Looking at your HTML, your “Calculate!” button is of type submit

Admittedly, this stackoverflow thread is nearly a decade old, but their solution is to change it to type button

Just tried it, it works :call_me_hand: (on mobile…)


Of course! :joy: Feel so dumb afterwards. I’m used to handling buttons with PHP, so I used submit 🤦🤦. Thanks for the answer!