`; }); [...phone_nam].forEach(element => { let phone = element.innerHTML .replace(/[^\d]+/g, "") .replace(/(\d{1})(\d{3})(\d{3})(\d{2})(\d{2})/, "$1 ($2) $3-$4-$5"); element.innerHTML = ""; element.innerHTML = phone; });