Thanks soooo much for that code @max_gb!
I’ve done an inspect in Developer Tools and found all the names…
So do you think would I put it here, after these lines which read the pk and create the elements?
function set_stripe_pk(pk_key) {
stripe = Stripe(pk_key);
elements = stripe.elements();
card = elements.create('card', { style: style });
card.mount('#card-element');
// Select the Stripe input fields
var id_cardnumber = document.getElementsByName("cardnumber")[0].value;
var id_expiry = document.getElementsByName("exp-date")[0].value;
var id_cvc = document.getElementsByName("cvc")[0].value;
var id_zip = document.getElementsByName("postalCode")[0].value;
// Disable Grammarly on them
id_cardnumber.setAttribute('data-gramm', 'false');
id_expiry.setAttribute('data-gramm', 'false');
id_cvc.setAttribute('data-gramm', 'false');
id_zip.setAttribute('data-gramm', 'false');
}