Add space after every 4th element

PHOTO EMBED

Tue Sep 13 2022 12:00:07 GMT+0000 (Coordinated Universal Time)

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