Easy Tutorial
❮ Dom Obj Image Prop Style Pagebreakbefore ❯

Submit type Attribute


Definition and Usage

The type attribute returns the form element type of the submit button.

For a submit button, this attribute is always "submit".

Syntax


Browser Support

All major browsers support the type attribute.


Example

The following example returns the form element type of the submit button:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tutorialpro.org(tutorialpro.org)</title>
<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 type="button" onclick="displayResult()">Display input type</button>

</body>
</html>

❮ Dom Obj Image Prop Style Pagebreakbefore ❯