javascript - Add params in html5 video (jQuery) -


i'm beginner in javascript , jquery , add parameter video element javascript.

<script>   $(document).ready(function () {   $('#foo').append($('autoplay')); }); </script>  <video id="foo" source type="video/mp4" src="foo.mp4"> 

i want result be:

<video id="foo" source type="video/mp4" src="foo.mp4" autoplay> 

this didn't work me. suggestions?

to change property on element should use prop()

$('#foo').prop('autoplay', true); 

http://api.jquery.com/prop/


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -