put space automatically after 4 characters in input javascript code example
Example: 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();
});