HTML DOM Input Submit type Property
Last Updated :
29 Jan, 2024
The Input Submit type Property in HTML DOM returns the type of form element of the submit field. It always returns the submit for an Input submit field.
Syntax:
submitObject.type
Return Values: It returns a string that represents the type of form element an input submit field is.Â
Example: This example returns the type of form element of the submit field.Â
HTML
<!DOCTYPE html>
< html >
< head >
< title >
HTML DOM Input Submit type Property
</ title >
</ head >
< body style = "text-align:center;" >
< h1 >GeeksforGeeks</ h1 >
< h2 >HTML DOM Input Submit type Property</ h2 >
< form id = "myGeeks" >
< input type = "submit" id = "Geeks"
value = "Submit @ geeksforgeeks" >
</ form >
< p >
Click on below button to Get Input
Submit Type Property Value
</ p >
< button onclick = "myGeeks()" >
Click Here!
</ button >
< p id = "result" ></ p >
< script >
function myGeeks() {
let btn = document.getElementById("Geeks").type;
document.getElementById("result").innerHTML = btn;
}
</ script >
</ body >
</ html >
|
Output:Â
Supported Browsers:
- Google Chrome 1
- Edge 12
- Firefox 1
- Opera
- Safari 1
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...