Side note, but can I introduce you to the <output> element? You can just set its value instead of its innerText. It’s perfect for calculators.
https://html.spec.whatwg.org/multipage/form-elements.html#th...
https://html.spec.whatwg.org/multipage/form-elements.html#th...
/s