I have this function here, that is supposed to copy my discount code to the users clipboard. The discount code displays fine for the user, but when I try to copy it nothing appears to be copied to the clipboard.
}).done(function(data) {
$('#discountCode').text(data.discount_code);
var copyText = data.discount_code;
copyText.select();
document.execCommand("Copy");
})
};
I'm hoping it's a simple syntax error. Thanks for the help.