HTML buttons by default submit the form they are inside. But what if you need to have a button inside a form (e.g. for Javascript functionality) and you don’t want it to submit the form? The answer is simple: type="button"
.
<button type="button">Do something</button>
source: W3Schools Button Type Attribute