Searching a bit in the link you posted, I found a good example of what you are asking
Taking inspiration from an example, here is the code
HTML
<form action="post">
<div class="select">
<input type="hidden" id="country" name="country"/>
<input type="tel" id="phone" name="phone">
</div>
</form>
Js
var input = $('#phone');
var country = $('#country');
var iti = intlTelInput(input.get(0))
input.on('countrychange', function(e) {
country.val(iti.getSelectedCountryData().iso2);
});
source
share