Cannot Read Property 'addeventlistener' Of Null Using Queryselector
I tried getElementsByClassName it got the same error, that's strange. In my html I'd change
to
Solution 1:
Class selector should start with .
dot: document.querySelector('.trigger-overlay');
.
MDN:https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors
Post a Comment for "Cannot Read Property 'addeventlistener' Of Null Using Queryselector"