Answer the question
In order to leave comments, you need to log in
How to solve the problem with the Backspace key "eating" the number mask?
The problem is with the virtual Backspace button, as it removes not only the number but also the mask that sets the format for the number. Who faced this, tell me how to solve this problem?
Here is the button script:
function del(){
var str = document.getElementById('phone').value;
parseInt(str)
document.getElementById('phone').value = str.substring(0, str.length-1);
console.log(str)
}
<input type="button" class="mybutton" onclick="del()" data-paste="→" value="→"/>
Answer the question
In order to leave comments, you need to log in
Add city code as a separate element ? for example through before.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question