addEvenListener doesn't work on dynamic button - javascript
问题 So I'm currently busy with learning JavaScript. I created some dynamic buttons and I tried to add an addEvenListener to it. But it doesn't work and I can't figure it out why it doesn't work. I'm just testing some stuff and I try to create buttons with values from the localstorage. It is almost working, only the addEvenListener isn't working. I just want a simple alert with the key from the localstorage. for (var i = 0; i <= localStorage.length-1; i++) { var categoryButton = document