Advertisement
alex91ckua

Int Phone Input Event Listener

Feb 15th, 2021
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. jQuery(document).ready(function(){
  3.   // #input_1_1 is id of the input with flags
  4.   const telInput = document.querySelector("#input_1_1");
  5.  
  6.   telInput.addEventListener("countrychange", function(e) {
  7.     const selectedCountryData = jQuery(telInput).intlTelInput('getSelectedCountryData');
  8.     console.log(selectedCountryData);
  9.   });
  10. });
  11. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement