Looking for the best way to have two events for same button click (vanilla javascript only please), first one should happen on touchstart the other one on the TransitionEnd.
Is this would be correct / best way to do it?
document.getElementById("btn").addEventListener('touchstart', playSound, false {
//Play sound, sync or async - not decided yet.
});
document.getElementById("btn").addEventListener('TransitionEnd', buttonAnimation, false {
//do an action after css animation ends, like open dialog...
});
document.getElementById("btn")once and assign the result to a variable. But other than that, yes, that's the correct way (assuming your actual code doesn't have syntax errors).falsefor?playSoundfunction? Why do you have something that looks like a function body in theaddEventListenercall?