Strict mode

As the user types in the input, ignore any irrelevant characters. Basically, the user can only enter numeric characters, and an optional plus at the beginning. Cap the length at the maximum valid number length. Play with this option on Storybook (using the React component).

Demo

Markup

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

Code

const input = document.querySelector("#phone");
window.intlTelInput(input, {
  initialCountry: "us",
  strictMode: true,
  utilsScript: "/intl-tel-input/js/utils.js?1730730622316" // just for formatting/placeholders etc
});