I'm new on javascript. I want to create form with two fields: phone number and country. I want to separate them on my database. How can i get country value from intl-tel-input?
For example:
<form>
<label>Phone Number</label>
<!-- using intl-tel-input -->
<input type="tel" name="phone">
<label>Country</label>
<!-- how can i get country value automatically here from phone number field? -->
<input type="text" name="country">
</form>
Anyone can help me figure this out? thanks in advance.