get action of submitted form

$("form").submit(function() {
    //some stuff...

    //get form action:
    var formAction = $(this).attr("action");

    //some other stuff...
});   

In JavaScript, you can use getAttribute method:

var form = document.getElementById('register_form');
var action = form.getAttribute("action")

Note: form.getAttribute("action") is safer than using form.action. Because if you have an input field named "action" within a form, then the browser can return that particular node instead of returning action URL of the form.

enter image description here


if you need Javascript without jQuery:

var action=document.getElementById('formId').action

with jQuery:

var action=$('#formId').attr('action');