JSFiddle - React, Tailwind, and code Playground
HTML
<form id="formTest" action="#" method="post">
<input type="text" id="textTest"/><br>
<input id="submitButtonDraft" type="submit" value="Save Draft" /><br>
<input id="submitButton" type="submit" value="Save" />
</form>
JavaScript
$(document).ready(function () {
$("#formTest").submit(function (e) {
e.preventDefault();
// get data from form's data
alert($(this).data('submitbutton').attr('value'));
});
$('input[type=submit]').click(function() {
// save as data on form's .data
$(this).parent().data('submitbutton', $(this));
});
});