HTML5 input type number not working in firefox

前端 未结 7 1411
闹比i
闹比i 2020-12-11 17:48

I am using HTML5 input type=number. Its working perfectly in Chrome browser, but its not working in Firefox and IE9.

I want to increment the quantity by

7条回答
  •  一向
    一向 (楼主)
    2020-12-11 18:14

    Alternately, you can use a textfield with a pattern="" attribute. Although it doesn't have the up and down buttons, it does validate for having the correct values:

    
    

    You can alter the pattern to your quantity wishes, it is now set for a value ranging from 1 to 9. Also you can add up/down buttons with JS/jQuery that have hotkeys bound to them for a more number-field-like feel.

提交回复
热议问题