sharepoint button reloads page
The problem here is with the <button> tag. Its default behavior is
to act as a submit button unless otherwise declared and will reload.
To keep your <button> tag, add type='button' to the button element.
Or you could go with the ole <input> tag with a type='button'.