Answers for "how to put space automatically after 4 characters javascript"

1

how to put space automatically after 4 characters javascript

document.getElementById('iban').addEventListener('input', function (e) {
  e.target.value = e.target.value.replace(/[^\dA-Z]/g, '').replace(/(.{4})/g, '$1 ').trim();
});
Posted by: Guest on October-09-2020

Code answers related to "how to put space automatically after 4 characters javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language