Sunday 15 August 2010

jquery - place javascript function result inside html tag -



jquery - place javascript function result inside html tag -

i want insert homecoming value of function tags attribute value in html

<video width="400" controls="controls"> <source src="xxxxx" /> </video> function returnvideolink() { homecoming "aa.mp4"; }

in above codes want functions homecoming value in above video tags src field marked xxxx

use jquery code:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script> function returnvideolink() { homecoming "aa.mp4"; } $(function(){ var src = returnvideolink(); $('source').attr('src', src); }); </script>

javascript jquery html html5

No comments:

Post a Comment