Why does my site reload whenever a user clicks a button?
ThatGhost

So here is my issue:
I am trying to make a login/signup system for my site.
By default buttons:

  • Look ugly
  • And automatically reloads the page

Both of those should be a easy fix.
For the look ugly you do some magic with css.
And for the reload page you type e.preventDefault() in your event listener. But for some reason that won't work for me.
My code gets the signup and login forms then adds the event listener for submit on there. But for some reason my e.preventDefault doesn't work. I have tried getting the button from the form and adding the click event listener.
Please help this is driving me insane.

PS: If you need full code I attached the repl. It will be in the login.signup.js file. Goodluck!

You are viewing a single comment. View All
Answered by Coder100 [earned 5 cycles]
View Answer
[deleted]

Are you asking a question about the title(as in "Why does my site reload whenever a user clicks a button?") or the one listed in your description?