1// 1. Acquire a reference to our <form>.
2// This can also be done by setting <form name="blub" id="myAwsomeForm">:
3// var form = document.forms.blub;
4
5var form = document.getElementById("myAwsomeForm");
6
7
8// 2. Get a reference to our preferred element (link/button, see below) and
9// add an event listener for the "click" event.
10document.getElementById("your-link-or-button-id").addEventListener("click", function () {
11 form.submit();
12});
13
14// 3. any site in your javascript code:
15document.getElementById('myAwsomeForm').submit();