console.log(alert('WORKING'));
var videoElement = document.getElementsByClassName('video-stream')[0];
videoElement.addEventListener(
'pause',
function(){
alert('paused!');
}
);
I know python but am trying to learn JavaScript. Im practicing by working on a Chrome extension but I'm already stuck.
The first line works I get popup when I open youtube in my chrome browser. But the next line does not. When I pause the video I do not get a popup. But if I copy the same line it into the console in chrome it does work. I will get a popup when I pause.