In HTML the default type of button is not button

The default type of <button> is "submit" which is why a <button> in a <form> submits the form when clicked.

Simply doing <button type="button"> removes this behaviour without the need for JavaScript.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button

Comments

Popular posts from this blog

Fix Controller Input when a Game Doesn't Use Steam Input

VSC Vanishing Go Imports

Fix Inability to Move Files to Trash in VSC