31

In Google Chrome, input[type=number] spin buttons are shown only on hover.

Chrome spin buttons

This is the code I use:

<input type="number" value="1" min="1" max="999" />

Is there any way to always show spin buttons?

pavel
  • 26,538
  • 10
  • 45
  • 61
Draex_
  • 3,011
  • 4
  • 32
  • 50

1 Answers1

53

You can target spin buttons using ::-webkit-inner/outer-spin-button and than just set opacity to 1 (spins are always there, but in default they have opacity: 0).

Code:

<style>  

input[type=number]::-webkit-inner-spin-button {
    opacity: 1
}

</style>
<input type="number" value="1" min="1" max="999">

Fiddle: http://jsfiddle.net/dk8fj/

pavel
  • 26,538
  • 10
  • 45
  • 61