4

Current behaviour on chrome is it's shown only when a user hovers over it:

enter image description here

By default, that spin box is not visible:
enter image description here

but in Mozilla, it's always visible:

enter image description here
How can I make spin box always visible in chrome?

https://jsfiddle.net/JerryGoyal/u4qoLcp4/

<input class="FlaggingPeriodTextBox" style=" width: 61px;    text-align: right;font-family: Segoe UI;margin-top: 9px;" type="number" min="1" max="999" value="7">
GorvGoyl
  • 42,508
  • 29
  • 229
  • 225

3 Answers3

6

jsFiddle

input[type="number"]::-webkit-outer-spin-button, 
input[type="number"]::-webkit-inner-spin-button {
opacity: 1 !important;
}
<input class="FlaggingPeriodTextBox" style=" width: 61px;    text-align: right;font-family: Segoe UI;margin-top: 9px;" type="number" min="1" max="999" value="7">

--

Miro
  • 8,402
  • 3
  • 34
  • 72
2

The spins are always there, you just need to target the spins which in your case is inner spin button and set opacity to 1

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

Fiddle

Rathore25
  • 46
  • 8
0

And if you want there is other solution with jquery

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<script type="text/javascript">
   $(document).ready(function(){
    $( "#spinner" ).spinner();
   });


</script>
 <p>
<input id="spinner" name="value" />
</p>

but you need to include jqueryUI check here working example

Ahmed
  • 1,666
  • 17
  • 23