Hey all I am trying to run a function and display a message when a user selects any other country than the US. However, I'm stuck as I can't even get the select box to log the event on changing of the country. Here's my code:
function checkIfInternational(e) {
console.log(e);
}
const shipCountry = document.querySelector("#billing_country"); //Logs the select box
shipCountry.addEventListener("change", checkIfInternational); // listening for the change event
Any ideas on why this is happening? Is Woocommerce preventing JS from running on the page or something?
Edit: JS Fiddle: https://jsfiddle.net/suoc57mg/1/