I have a video and some JavaScript code. The code says
var videoIDRAW = getUrlVars()["watch"];
var videoID = videoIDRAW.toString();
var videoIDFILE = videoID.concat(".mp4");
var videofile = document.getElementById("vid");
videofile.setAttribute("src", videofile)
videofile is
<video width="912" height="513" controls >
<source id="vid" src="" type="video/mp4">
</video>
why do i get the TypeError: videofile is null?
EDIT: modified videofile.setAttribute("src", videofile.toString())
, same error