<link rel="stylesheet" href="styles/intlTelInput.scss">
<input type="tel" required id="#consultPhone">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/15.0.0/js/intlTelInput.js"></script>
<script src="scripts/scripts.js"></script>
<script type="text/javascript">
var consultInput = document.querySelector('#consultPhone');
var iti = window.intlTelInput(consultInput, {
separateDialCode:true,
utilsScript: "https://cdn.jsdelivr.net/npm/[email protected]/build/js/utils.js",
});
window.iti = iti;
</script>
So this is my code, when I open the page the input is empty and i get this error: Uncaught TypeError: Cannot read property 'getAttribute' of null at new Iti (intlTelInput.js:146 at intlTelInput.js:1282 at index.html:973
Basically I am stupid, forgot to remove the hashtag from the id ๐
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With