document.querySelector('[name="bob"]')
.addEventListener('submit',
functionThatDoesSomethingAfter);
Note the form has to already be in the DOM so put the code at the end of the body tag.
https://developer.mozilla.org/en-US/docs/Web/API/document.querySelector
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener