This is used to specify the default action of the button. The button type states that “it has no default behavior. It can have client-side scripts associated with the element’s events, which are triggered when the events occur.” Normally, this is how a button would act by itself. However, a button is normally found within a form, where when clicked it automatically submits the form. By specifying type=button, it overrides this default behavior, so it would not submit. See here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button
solved Why boostrap put type=”button” in button tag