There are two things here that you’re probably already aware of. First, HTML includes an
<output> element that allows you to display the “result of a calculation”. It’s a form element and it’s been around for some time, having been added in HTML5.
The other thing you’re likely to be aware of is that the
for attribute is normally used on the
<label> element to associate a
<label> with a form element. This aids accessibility and usability, as you’ve probably discovered as both a developer and a user. But interestingly, the
for attribute can also be used on the