Typeof does't work how I want


I want to check type of an input number. When I write number (for example 5) the code doesn’t because I want: http://jsfiddle.net/8Observer8/9wsdK/

typeof is not useful for determining if you have a number there.
Input fields are always provided as a string.

You can use parseFloat() to check if a string can be interpreted as a number. For example:

if (!parseFloat(number)) {


A prompt will always return a String.
Simple as that, really.


It’s the solution: http://jsfiddle.net/8Observer8/9wsdK/1/