It seems to me that this is like a readonly input, exposing a value that you can change and apparently forcing itself in the window object even if you specify the name attribute. If you replace it with a span that has an id="output" and the .value to .innerHTML in the Javascript, it works just as well.
I see it more useful if we can specify a type, like the input has. It is interesting you mentioned the option to define a combination of inputs, but you have not used it :) Something like for="price vat".
Hey, yeah I think it's like many semantic HTML, people tend to make their own options, but why?
We have all this semantic HTML for a reason, I would think.
As for the for the label, indeed, I choose not to show it, because to me it was confusing if that was causing the output value.
So wanted to not dive into that for this guide, but maybe I should state it as the full version.
It seems to me that this is like a readonly input, exposing a value that you can change and apparently forcing itself in the window object even if you specify the name attribute. If you replace it with a span that has an id="output" and the .value to .innerHTML in the Javascript, it works just as well.
I see it more useful if we can specify a type, like the input has. It is interesting you mentioned the option to define a combination of inputs, but you have not used it :) Something like for="price vat".
Hey, yeah I think it's like many semantic HTML, people tend to make their own options, but why?
We have all this semantic HTML for a reason, I would think.
As for the for the label, indeed, I choose not to show it, because to me it was confusing if that was causing the output value.
So wanted to not dive into that for this guide, but maybe I should state it as the full version.
I usually create my own HTML tag, like
<hello></hello>
. Then, I manipulate withdocument.querySelector("hello").innerText = "World"
To what advantage?
I don't quite know how a custom tag benefits you?
For simplify writing. So, I don't write
<div class="hello"></div>
. Just<hello></hello>