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?
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?
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
In this case you could use a Jquery mask, such as link , I think it solves your problem.