Level 88
e stands for event here, however it's only available whenever your action works with a callback for certain types. For example on click or onkeypress
element.onkeypress = function(e) {
// Do something here
};
element.onkeypress = (e) => {
// Do something here
};
Your copyToClipboard is a custom method so it doesn't understand that and you can't magically get that element.
Normally you would just create a normal method and pass it to there
function copyToClipboard(e) {
// Do something here
})
1 like