How can I get the valid or invalid status of the postal code field in the Stripe Address Element
I tried this code. but it has not worked. here is the code :
const postalCode = elements.getElement('postalCode');
const isInvalid = postalCode._invalid;
const isEmpty = postalCode._empty;
const isValid = !(isEmpty || isInvalid);
console.log(isValid);
Also, I tried this method too. but it's not returning the valid or invalid status of the field.
addressElement.on('change',(e)=>{
console.log(e);
});
Is there anyway to get this status?
Thank you.