The Submit name property
The Submit objectDefinitions and usages
The name property can set or return the name property value of the submit button.
The name property is used to transfer data to the server after the form is submitted, or to refer to the form data in Javascript.
Note: Only the name property of the form element passes the data value after the form is submitted.
Grammar
Set the name property:
Returns the name property:
Browser support
The name property is supported by all major browsers
The following example shows the name of the confirmation button:
<html>
<head>
<meta charset="utf-8">
Online tutorials for W3Cschool (w3cschool.cn)
<script>
function displayResult(){
var x=document.getElementById("submit1").name;
alert(x);
}
</script>
</head>
<body>
<form>
Email: <input type="text" id="email">
<input type="submit" name="submit1" id="submit1">
</form>
the name of the submission button is displayed with the name of the submit button, "button" onclick, "displayResult()".
</body>
</html>
Try it out . . .
The Submit object