Skip to content Skip to sidebar Skip to footer

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

error function tog

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"