Can someone guide me on how to keep VAT field visible and required for non-USA countries and hide and not require for USA country on checkout page add address ?
I tried this way but its not working
require(['jquery'],function($){
jQuery( document ).ready(function() {
jQuery('#co-shipping-form div[name="shippingAddress.country_id"] select').change(function(){
var cnt = jQuery(this).val();
if ( cnt == 'US'){
jQuery('#co-shipping-form [name="shippingAddress.vat_id"]').hide();
}else{
jQuery('#co-shipping-form [name="shippingAddress.vat_id"]').show();
}
});
});
});
Thanks
jQuery('#co-shipping-form div[name="shippingAddress.country_id"] select')
its seems you are using wrong selector. can you add your html?