Numeric Input Not Working

Using an html element it seems that notebooks are unable to parse the value typed into the element. For example if I insert this expression into a notebook:

viewof asdf = html`<input type="number" value="40" max="100" min="0" step="5">`

and then try to use the value of “asdf” elsewhere in the notebook, it turns out that the value of “asdf” is NaN. You can see this in the Input example:

Maybe there’s been some change to the site since you posted this, but I’m not able to reproduce the behavior you’re describing; could you provide an example notebook that fails for you? I tried creating two cells in a blank notebook, one containing:

viewof asdf = html`<input type="number" value="40" max="100" min="0" step="5">

and one containing asdf, and the output of asdf was 40, as expected. I tried this both in Firefox and Chrome.

Note that the examples under “Numbers” in the notebook you’ve linked start out as NaN because they begin with invalid input: the first one starts out blank, and the second one starts out with 13+. When I start typing digits into those inputs, the values of the cells changes appropriately.

Oh I didn’t even think about browser compatibility…

LOL well I am using Edge so I think that just about answers it for all of us. In the off chance Observable is trying to support Edge it’s something to note :rofl:

Regardless, thanks for the response!

For the curious, it looks as though this has been an outstanding bug in Internet Explorer since early 2014 … even though the issue is marked as “fixed”:

https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/110895/