javascript - Show iframe or div inside video tag after video end -


i have video tag :

<video id="test" autobuffer style="width:100%;" onclick="this.play(); controls>         <source src="some file" type="video/mp4">      </video> 

and javascript :

    <script type='text/javascript'>     var video = document.getelementsbytagname('test')[0];         video.onended = function(e) {         document.getelementbyid('test').innerhtml= '<iframe src="http://www.example.com/myframe" width="100" height="100"></iframe>';         }; </script> 

idea ,when video end (video.onended) show iframe or div in video tag. advertisment info..

i try,but no succes..

tnx,

you need replace whole video element rather try , replace child within it. use parentnode video elements parent

document.getelementbyid('test').parentnode.innerhtml= '<iframe src="http://www.example.com/myframe" width="100" height="100"></iframe>';


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -