I try to get jQuery object of a submit button in a specific form (there are several forms on the same page).
I managed to get the form element itself. It looks somet
This works for me:
var curSubmit = $("input[type=submit]",this);
where this mean current form submitted
for ex. to get the name of submitted button and all inputs submitted
$( "form" ).on( "submit", function( event ) {
event.preventDefault();
var data = $(this).serialize(); //all input variables
console.log(data); //print data in console
var submit = $("input[type=submit]",this).attr('name');
alert(submit); // name of submit button
});