The Submit type property

HTML DOM Submit type property The Submit object

Definitions and usages

The type property returns the type of form element for the confirmation button.

For the confirmation button, the property is always "submit".

Grammar

submitObject.type


Browser support

HTML DOM Submit type property HTML DOM Submit type property HTML DOM Submit type property HTML DOM Submit type property HTML DOM Submit type property

The type property is supported by all major browsers


The following example returns the type of form element for the confirmation button:

<! DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
Online tutorials for W3Cschool (w3cschool.cn)
<script>
function displayResult(){
var x=document.getElementById("submit1").type;
alert(x);
}
</script>
</head>
<body>

<form>
Email: <input type="text" id="email">
<input type="submit" id="submit1">
</form>
"button" onclick" "displayResult()"

</body>
</html>

Try it out . . .


HTML DOM Submit type property The Submit object