Your expectations are reasonable given the name of the property, but when reading the actual specifications / documentation :
The valueAnumber IDL attribute represents the value of an element, interpreted as a number.
On receipt, if the valueAsNumber attribute is not applied, as defined for the current state of the input element type attribute, then return a Not-a-Number (NaN) value.
Here is a table listing the valueAsNumber that are related to valueAsNumber . It:
Date and time,
The date,
Month,
A week,
Time
Local date and time
room
Range
Yes, this is a rather weird API solution.
source share