Advertisement
NikolayBezay

Iqos copy coupon and paste it to form input;

Apr 15th, 2021
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var currentCoupone = 'IQOSAPR21';
  2. var input = document.createElement('input');
  3. document.body.appendChild(input);
  4. input.setAttribute('value', currentCoupone);
  5. input.select();
  6. document.execCommand('copy');
  7. document.body.removeChild(input);
  8. window.sessionStorage.setItem('adoric_coupone_code', currentCoupone);
  9. var couponInput = document.querySelector('.coupon_info input[name="coupon_code"]');
  10. if (couponInput) {
  11.     couponInput.value = currentCoupone;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement