Answer: Get the form element and call its submit() method (or requestSubmit()).
<form id="myForm" action="/save" method="post">
<input type="text" name="username">
</form>
<button onclick="sendForm()">Send</button>
<script>
function sendForm() {
document.getElementById("myForm").submit();
// or: document.forms["myForm"].submit();
}
</script>
form.submit() sends the form directly to the URL in action. Note that it skips the form's onsubmit handler and HTML validation such as required.
If you want validation and the submit event to run, use form.requestSubmit(), which behaves like the user clicking a submit button.