This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In the specifications, the example for the output element is: <form onsubmit="return false"> <input name=a type=number step=any> + <input name=b type=number step=any> = <output onforminput="value = a.value + b.value"></output> </form> However, "a.value + b.value" is a string concatenation so if a.value='1' and b.value='2' we are getting "12" in output. It sounds the example idea is to show "3" instead of "12". There are two solutions: 1. using * instead of + so there will be no more confusion with + method of the string concatenation. 2. changing onforminput to "value = parseFloat(a.value) + parseFloat(b.value);"
Or even better, make it <output onforminput="value = a.valueAsNumber + b.valueAsNumber"></output>
Indeed, .valueAsNumber is even better ;)
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document: http://dev.w3.org/html5/decision-policy/decision-policy.html Status: Accepted Change Description: see diff given below Rationale: Concurred with reporter's comments.
Checked in as WHATWG revision r5005. Check-in comment: Make the example make more sense. http://html5.org/tools/web-apps-tracker?from=5004&to=5005