Comment by DangerousPie
Comment by DangerousPie 3 days ago
It's still better than <span> or <div> though, isn't it? Which is what most people are using right now...
Comment by DangerousPie 3 days ago
It's still better than <span> or <div> though, isn't it? Which is what most people are using right now...
Too late to edit, but there is a mistake s/document.elements/myForm.elements/r :
- const inputField = document.elements.namedItem("number");
- const outputField = document.elements.namedItem("result");
+ const inputField = myForm.elements.namedItem("number");
+ const outputField = myform.elements.namedItem("result");
Unlike <div> and <span>, <output> becomes part of the form and you can target it as a named form item, e.g.