<p>请点击按钮来创建 VIDEO 元素,该元素将播放 .ogg 文件格式的影片。</p>
<button onclick="myFunction()">试一下</button>
var x = document.createElement("VIDEO");
x.setAttribute("width", "320");
x.setAttribute("height", "240");
x.setAttribute("controls", "controls");
x.setAttribute("src", "/img/movie.mp4");
document.body.appendChild(x);
document.getElementById("demo").innerHTML = "<b>注释:</b>IE 和 Safari 不支持 .ogg 文件格式。这只是一个例子。如需使其在所有浏览器中运行,您应该在 video 元素中使用 source 元素。";