Add space after every 4th element

PHOTO EMBED

Tue Sep 13 2022 12:00:07 GMT+0000 (UTC)

Saved by @Kristi #javascript

const input = document.querySelector('input')
//Add space e.g 1234 5678 9012
input.innerHTML = input.value.replace(/\d{4}(?=.)/g, '$& ');
content_copyCOPY