Back

Example: Modify country data

Use static getCountryData method to update the data to only show localised country names.

Markup

<input id="phone" type="tel">

Code

var countryData = $.fn.intlTelInput.getCountryData();
$.each(countryData, function(i, country) {
  country.name = country.name.replace(/.+\((.+)\)/,"$1");
});
$("#phone").intlTelInput({
  utilsScript: "../../lib/libphonenumber/build/utils.js" // just for formatting/placeholders etc
});

Result