Hello,
I am adding an addEventListener function to a (video) DIV so that when people click on the Thumbnail of the Video, it will open up and start paying in the main Video window.
You can see it here:
https://www.anoox.com/ask_answer/ask_discuss.php
So click on the Embed Video button and copy & paste iframe Video, say from YouTube, such as:
//<iframe width="853" height="480" src="https://www.youtube.com/embed/AJm8PeWkiEU" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
upon doing this the JS function: embed_video ()
will throw Error: Uncaught TypeError: target_div.addEventListener is not a function
at embed_video (ask_discuss.php:329)
Why? I have checked it 10 different ways and of course addEventListener is how we add dynamically a function to a DIV. So what is wrong?
Thanks.