Zero right - Input

-1

Good afternoon,

I have an input text that only receives a number, I need it in the act of typing a value, then adding the number zero to the right, could you help me?

    
asked by anonymous 09.11.2016 / 16:19

2 answers

1
var input = document.querySelector('#meuInput');
input.addEventListener('keyup', function() {
    this.value = this.value + 0;
});

The idea is: every time a key is deprecated, the value of input should receive 0 at the end.

Example online: link

    
09.11.2016 / 18:30
0

In this case you could use a Jquery mask, such as link , I think it solves your problem.

    
10.11.2016 / 13:57