i have been walking through this problem of script.js:31 Uncaught TypeError: Cannot read properties of null (reading 'addEventListener') how can i solve this ?
`
masterPlay.addEventListener('click', ()=>{
if(audioElement.paused || audioElement.currentTime<=0){
audioElement.play();
masterPlay.classList.remove('fa-play-circle');
masterPlay.classList.add('fa-pause-circle');
gif.style.opacity = 1;
}
else{
audioElement.pause();
masterPlay.classList.remove('fa-pause-circle');
masterPlay.classList.add('fa-play-circle');
gif.style.opacity = 0;
}
})
I don't know how to solve it ca any body help me out?
` tag might solve issue. script loading before body so event is `null`
– Dreamy Player Nov 20 '22 at 12:32