HTML DOM Output type Property
Last Updated :
15 Jun, 2023
The HTML DOM Output type Property is used for returning the type of Output Element, the type of element the Output object represents. This property will always return the “output”.
Syntax:
outputObject.type
Parameter: This property does not accept any parameter.
Return value: It returns a string value that represents the type of HTML element that the output element belongs to.
Example: This Example returns the Output type Property.
HTML
<!DOCTYPE html>
< html >
< head >
< title >
HTML DOM Output type Property
</ title >
< style >
body {
text-align: center;
}
h1 {
color: green;
}
</ style >
</ head >
< body >
< h1 >GeeksforGeeks</ h1 >
< h2 >
HTML DOM Output type Property
</ h2 >
< form oninput=" sumresult.value = parseInt (A.value)
+ parseInt(B.value) + parseInt(C.value)">
< input type = "number" name = "A" value = "50" /> +
< input type = "range" name = "B" value = "0" /> +
< input type = "number" name = "C" value = "50" />
< br /> Submit Result:
< output name = "sumresult" id = "geeks" for = "A B C" >
</ output >
< br >
< br >
</ form >
< Button onclick = "myGeeks()" >Submit</ Button >
< h2 id = "sudo" ></ h2 >
< script >
function myGeeks() {
let x = document.getElementById("geeks").type;
document.getElementById("sudo").innerHTML = x;
}
</ script >
</ body >
</ html >
|
Output:
Supported Browsers: The browsers supported by HTML DOM Output type Property are listed below:
- Google Chrome 10.0
- Firefox 4.0
- Opera 11.0
- Safari 5.1
Share your thoughts in the comments
Please Login to comment...