Dear All,
I am fairly new to JS and just started to explore it.
Currently I am trying to assign a function to elements when they are clicked.
I followed the tutorials on Corvid and it ended up hideously long.
Basically I have 50 buttons assigned to 5 groups.
For each button, there will be a ‘OnClick’ event and pass a relevant value to another function ‘sotreSelection’ and return the readable value to an GTM event as the following
export function gmapAA_click(event) {
storeSelection(0);
console.log(`Execute Successful': ${selectedStore}`);
customEvent(selectedStore,event);
}
Therefore the next export function will be:
export function gmapAB_click(event) {
storeSelection(1);
console.log(`Execute Successful': ${selectedStore}`);
customEvent(selectedStore,event);
}
Is there any clearer way to process what I am after?
Thank you.