i have a small problem.
I\'m learning Javascript and I decided to make a currency converter but, my page keeps refreshing after the data is being displayed.
The default behavior of button is act like a submit button if it's inside a form. If you add type='button', it stops acting like a submit button
You can also just return false from the handler (like you could with ) to prevent the default behavior.
Not that you don't really need a form here, since you're not submitting it. Removing the form also fixes your problem.
See How to prevent buttons from submitting forms