Given this markup
<p><a href="#">LOAD VIDEO</a></p>
<video id="video" controls width="560">
<source id="webm" type="video/webm" />
<span>zoom-club.webm</span>
</video>
And this script
$(document).ready(function(){
$('a').on('click',function(){
var path = "../assets/" + $('span').text();
$('source').attr('src', path);
$('video#video').load();
$('video#video').play();
});
});
Why do I get this error?
Uncaught TypeError: undefined is not a function
This will actually work using tradition Javascript and getElementById, but for some reason the way I am referencing the video tag is broken. What gives?