The following example code validates a phone number and checks whether the user provided a phone number in the correct format … How to place a div inside an iframe for IE ? Note the tabIndex, more on this later in the article. Example Input: 9809142333 Output: (980) 914-2333 Format phone number without country code. Format Phone Number function remarks. This makes sense as a default, it’s the traditional link styling, and what Google still uses in it’s SERP pages. Now once we have our input ready we can format it in US phone format.