plus sign in html input type=number

后端 未结 3 1805
终归单人心
终归单人心 2020-12-12 03:56

Does anyone know if it\'s possible to add a plus sign in a html input type=number field? I have a scenario whereby users need to enter a modifier value which is either +1 t

3条回答
  •  时光说笑
    2020-12-12 04:19

    I don't think it is possible to manipulate the input. the default is a "-" for negative and no sign for positive numbers.

    even if you checked a create UI frameworks like:

    Jquery UI, Bootstrap, Angular Material ...

    I guess the only solution is to write your own custom code.

    two scenarios are available:

    1- an input with Text and the manipulating will be in javascript.

    2- create a pipe in angular2 and give it to the element. which I think it is much easier than the first one.

提交回复
热议问题