[Solved-6 Solutions] Can We hide the HTML 5 number input’s spin box - javascript tutorial
Problem:
How to hide the HTML5 number input's spin box ?
Solution 1:
Firefox:
In Firefox browser, the default value of the -moz-appearance property on these elements is number-input
.
To changing the value of text field effectively to removes the spinner.
We want the spinner to be hidden initially, and then appear on hover/focus.
Chrome:
In Chrome, the default value of the -webkit-appearance property on these elements is textfield
.
To remove the spinner, the -webkit-appearance property's value wants to be changed as none on the ::-webkit-outer-spin-button/::-webkit-inner-spin-button
pseudo classes.
Margin: 0 is used to remove the margin in earlier versions of Chrome. Here 'inner-spin-button' pseudo class is the default value:
Solution 2:
Using CSS to hides the spin-button for webkit browsers.
Solution 3:
Currently Firefox 29 adds support for number elements:
Solution 4:
To display a numeric keyboard in an iPhone browser, we can use the following code:
A pattern of \d* will also work.
Solution 5:
Using input type="tel". It pops up a keyboard with numbers, and it doesn’t show spin boxes. It doesn't requires JavaScript or plugins.
Solution 6:
This is one of the solution: