Inside the form, action is a string reference to the action of the form. If you change your onclick to alert(action) , you will get a form action (which will be an empty string for your specific form).
In the same way, form will be a reference to the form, and method will contain the form method if you use them in the form. window.action will still reference your function.
source share