The problem with the virtual button Backspace, as it removes not only the number but also the mask that sets the format for the number. Who faced this tell me how you can 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) } here is the button layout:
<input type="button" class="mybutton" onclick="del()" data-paste="→" value="→"/> Here is the full code: https://jsfiddle.net/0xL0fctq/98/