I'd like to know what the <output>
tag is for.
I saw this example here on the internet:
<form onsubmit="return false" oninput="o.value = a.valueAsNumber + b.valueAsNumber">
<input name="a" type="number" step="any"> +
<input name="b" type="number" step="any"> =
<output name="o" for="a b"></output>
</form>
Looking at the example above, I realized that this value
property is something that does not exist in other elements normally. Generally, you have the property value
in input
, but it's interesting to see that in the output
tag too.
I wanted to understand a little more about it to see if I can use it in my day to day life.
- What is the purpose of this tag?
- What's the difference of writing a value in a
<output>
tag to the other tags? That is, was not it enough just to useinnerText
?
Note : I even saw that the site has a question on the subject , however there is no answer on the purpose of the tag.