How to check if a button element was clicked?
I know about
document.getElementById('element').onclick but I was wondering about it because of the event listeners (
addEventListener()). Wouldn't onclick be the old handler? Is there any way to check if a button was clicked? It would be helpful given I "need" it for a conditional.
Coding is a challenge, get used to it
Always remember to debug
Try the guess & check method
Break it down into simple steps