Menu
I have some javascript code that will determine if a code entered into an input will match any codes in a list. (It’s a discount code input)
discountButton.addEventListener('click', () => {
if (discountInput.value === 'hellogoodsir') {
discountArea.style.outline = 'var(--main-color) 2px solid';
} else {
discountArea.style.outline = 'red 2px solid';
};
})
right now instead of it being a list, the code will have to be the same as hellogoodsir, but if you click inspect, and into the code files you can see the code you need to input. The list of codes will be different codes set by the user of the document, and I need the list to be protected so someone has to get a discount code their own way (through promotions etc) Any way to do this?