Back

Example: Lookup user's country

Set defaultCountry to 'auto' to perform a JSONP request to ipinfo.io, which returns the user's country based on their IP address.

Markup

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

Code

$("#phone").intlTelInput({
  defaultCountry: "auto",
  utilsScript: "../../lib/libphonenumber/build/utils.js" // just for formatting/placeholders etc
});

Result