I'm creating a whole page using the Document.createElement () method, but I'm having a problem creating a video tag. It creates the element but does not play the video, I would like to know if the video tag works with createElement.
var table = document.createElement("TABLE");
table.setAttribute("align","center");
var trplay = document.createElement("TR");
var tdplay = document.createElement("TD");
var player = document.createElement("VIDEO");
player.setAttribute("width","502");
player.setAttribute("height","360");
player.setAttribute("id","Video1");
var source = document.createElement("SOURCE");
source.setAttribute("scr","video1.webm");
source.setAttribute("type","video/webm");
It creates the following code:
<table align="center">
<tr>
<td>
<video width="502" height="360" id="Video1">
<source scr="video1.webm" type="video/webm">
</video>
</td>
</tr>
</table>