Prevent submit event from sending request to server

To prevent default behavior of submit event in JavaScript, use the following:

form.addEventListener('submit', runEvent);
runEvent(e) {
  ... // do something
  e.preventDefault();
}