Format phone numbers in input fields bookmarklet

PHOTO EMBED

Sat Jan 01 2022 15:52:00 GMT+0000 (UTC)

Saved by @ralphie #bookmarklet #javascript

javascript:(function() {  document.querySelector('input:focus').value=document.querySelector('input:focus').value.replace(/(\d{3})(\d{3})(\d{4})/,(m,p1,p2,p3)=>'('+p1+') '+p2+'-'+p3);})();
content_copyCOPY