How to make the size of the input match what is inside it? That is, if the number has reached 100, then the input expands.
No matter how it is done - via CSS or JS .
Here we are talking about the input type = "number" Do not confuse with other issues.
input { width:30px; } input[type=number]::-webkit-inner-spin-button { opacity:1; } span { padding:2px; border:1px solid #ccc; } <input type="number" value="10" /> <br> Пример:<br> <span class="10">10</span><br><br> <span class="100">100</span> 
patterndoes not work - Mr. Black