Number input type

Form field type for numbers.

Spec https://html.spec.whatwg.org/multipage/forms.html#number-state-(type=number)
Status WHATWG Living Standard
IE Edge Firefox Chrome Safari Opera
      98    
    95 (3) 97    
    94 (3) 96 TP  
11 (1) 95 93 (3) 95 15 80
10 (1) 94 92 (3) 94 14.1 79
9 93 91 (3) 93 14 78
8 92 90 (3) 92 13.1 77
Show all
7 91 89 (3) 91 13 76
6 90 88 (3) 90 12.1 75
5.5 89 87 (3) 89 12 74
  88 86 (3) 88 11.1 73
  87 85 (3) 87 11 72
  86 84 (3) 86 10.1 71
  85 83 (3) 85 10 70
  84 82 (3) 84 9.1 69
  83 81 (3) 83 9 68
  81 80 (3) 81 8 67
  80 79 (3) 80 7.1 66
  79 78 (3) 79 7 65
  18 (4) 77 (3) 78 6.1 64
  17 (4) 76 (3) 77 6 63
  16 (4) 75 (3) 76 5.1 62
  15 (4) 74 (3) 75 5 60
  14 (4) 73 (3) 74 4 58
  13 (1) 72 (3) 73 3.2 57
  12 (1) 71 (3) 72 3.1 56
    70 (3) 71   55
    69 (3) 70   54
    68 (3) 69   53
    67 (3) 68   52
    66 (3) 67   51
    65 (3) 66   50
    64 (3) 65   49
    63 (3) 64   48
    62 (3) 63   47
    61 (3) 62   46
    60 (3) 61   45
    59 (3) 60   44
    58 (3) 59   43
    57 (3) 58   42
    56 (3) 57   41
    55 (3) 56   40
    54 (3) 55   39
    53 (3) 54   38
    52 (3) 53   37
    51 (3) 52   36
    50 (3) 51   35
    49 (3) 50   34
    48 (3) 49   33
    47 (3) 48   32
    46 (3) 47   31
    45 (3) 46   30
    44 (3) 45   29
    43 (3) 44   28
    42 (3) 43   27
    41 (3) 42   26
    40 (3) 41   25
    39 (3) 40   24
    38 (3) 39   23
    37 (3) 38   22
    36 (3) 37   21
    35 (3) 36   20
    34 (3) 35   19
    33 (3) 34   18
    32 (3) 33   17
    31 (3) 32   16
    30 (3) 31   15
    29 (3) 30   12.1
    28 29   12
    27 28   11.6
    26 27   11.5
    25 26   11.1
    24 25   11
    23 24   10.6
    22 23   10.5
    21 22   10.0-10.1
    20 21   9.5-9.6
    19 20   9
    18 19    
    17 18    
    16 17    
    15 16    
    14 15    
    13 14    
    12 13    
    11 12    
    10 11    
    9 10    
    8 9    
    7 8    
    6 7    
    5 6    
    4 5    
    3.6 4    
    3.5      
    3      
    2      
Safari on iOS Opera Mini Android Browser Blackberry Browser Opera Mobile Android Chrome Android Firefox IE Mobile Android UC Browser Samsung Internet QQ Browser Baidu Browser KaiOS Browser
15 (1,2) all 94 (1,2) 10 (1,2) 64 (1,2) 94 (1,2) 92 (1,3) 11 (1,2) 12.12 (1,2) 15.0 (1,2) 10.4 (1,2) 7.12 (1,2) 2.5 (3)
14.5-14.8 (1,2)   4.4.3-4.4.4 (1,2) 7 12.1     10 (1,2)   14.0 (1,2)      
14.0-14.4 (1,2)   4.4 (1,2)   12         13.0 (1,2)      
13.4-13.7 (1,2)   4.2-4.3 (1,2)   11.5         12.0 (1,2)      
Show all
13.3 (1,2)   4.1 (1,2)   11.1         11.1-11.2 (1,2)      
13.2 (1,2)   4 (1,2)   11         10.1 (1,2)      
13.0-13.1 (1,2)   3   10         9.2 (1,2)      
12.2-12.5 (1,2)   2.3             8.2 (1,2)      
12.0-12.1 (1,2)   2.2             7.2-7.4 (1,2)      
11.3-11.4 (1,2)   2.1             6.2-6.4 (1,2)      
11.0-11.2 (1,2)                 5.0-5.4 (1,2)      
10.3 (1,2)                 4 (1,2)      
10.0-10.2 (1,2)                        
9.3 (1,2)                        
9.0-9.2 (1,2)                        
8.1-8.4 (1,2)                        
8 (1,2)                        
7.0-7.1 (1,2)                        
6.0-6.1 (1,2)                        
5.0-5.1 (1,2)                        
4.2-4.3 (1,2)                        
4.0-4.1 (1,2)                        
3.2 (1,2)                        

Notes

  1. Does not support increment/decrement, either via buttons in UI or via arrow up & down keys.

  2. UI widget does not take the "step", "min" or "max" attributes into account.

  3. Firefox doesn't support autocomplete content via datalist elements.

  4. Does not include increment/decrement buttons, but does support increment/decrement via arrow up & down keys.

Bugs

  • IE10 and IE11 also have broken .valueAsNumber results that don't follow the spec, e.g. for
    input.value = "9" input.valueAsNumber returns NaN.

  • The .stepUp and .stepDown methods incorrectly invoke InvalidStateError exceptions in IE 10 and 11.

  • IE does not convert the value to an invariant culture. IE simply submits the value as it was typed, using the user's regional settings, but the spec says the browser should submit in a normalized way.

  • Currently no mobile browsers and very few desktop browsers support using commas for languages where commas are used as decimal separators.

  • Firefox 39 in Mac OSX by default does not prevent alpha characters input and Firefox 42 validates only but It doesn't disable alpha keys input.

  • While in newer Edge versions changing the value through up/down arrow keys is supported, no input or change event is fired. See the MS Edge bug concerning input and MS Edge bug concerning change respectively.

Resources

Data by caniuse.com
Licensed under the Creative Commons Attribution License v4.0.
https://caniuse.com/input-number