Adding Event Listener To Audio Html5 Tag In Javascript
Hi I'm creating a new audio tag element in Javascript this is the code: var audio = document.createElement('audio'); audio.setAttribute('id','myid'); audio.setAttribute('autoplay',
Solution 1:
try:
audio.addEventListener('ended', foo);
This is the correct and standard method to add event listeners.
Post a Comment for "Adding Event Listener To Audio Html5 Tag In Javascript"