0
How can I add more IDs ?
(function() { var input = document.getElementById('phone'); var pattern = /^[6-9][0-9]{0,9}$/; var value = input.value; !pattern.test(value) && (input.value = value = ''); input.addEventListener('input', function() { var currentValue = this.value; if(currentValue && !pattern.test(currentValue)) this.value = value; else value = currentValue; }); })();
2 Antworten
0
thank solved