How to change the country flag in mobile number field as specific to any one country

I want the Mobile number field to have my country flag selected by default. How do i do that?

Below is the custom Javascript code which can help to set the country flag to any specific country by default.

Assuming the ID of the Mobile number field input box is : igchk (please change this as per the id of your input field)

Below code will set the country as India by default.

Blockquote
const telContainer = document.querySelector("#igchk").closest(’.iti.iti–allow-dropdown’);
const flagContainer1 = telContainer.querySelector(’.iti__selected-flag’);
const flagContainer2 = telContainer.querySelector(’.iti__flag-container #iti-0__country-listbox #iti-0__item-in’);
flagContainer1.click();
flagContainer2.click();

Thanks.