Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schellenbergk/504427e2bf0a9782493365162d2dcc6e to your computer and use it in GitHub Desktop.
Save schellenbergk/504427e2bf0a9782493365162d2dcc6e to your computer and use it in GitHub Desktop.
document.querySelectorAll('.next-input').forEach(i => {
let replacements = [
'-taxes-fees-included',
'-taxes-and-fees-included',
'-taxes-fees-inluded',
'-taxes-fee-included',
'-tax-fees-included',
'-taxes-fees-incl'
];
let v = i.value;
replacements.forEach(r => {
v = v.replace(r,'');
});
let found = false;
replacements.forEach(r => {
if (i.value.match(r)) found = true;
});
if(found) {
i.value = v;
var nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;
nativeInputValueSetter.call(i, v);
var e = new Event('input', { bubbles: true});
i.dispatchEvent(e);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment