document.addEventListener("DOMContentLoaded", function () {
    var input = document.querySelector("#phone");

    var iti = window.intlTelInput(input, {
        initialCountry: 'lb', // Set the default country
        separateDialCode: true, // Display the country code separately
    });

    // Listen for changes
    input.addEventListener("input", function () {
        var phoneNumber = iti.getNumber();
        console.log(phoneNumber);
    });
});