最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

html - Create new HTML5 video element throught JavaScript - Stack Overflow

programmeradmin10浏览0评论

I am trying to create a new HTML5 video elemnt entirely throught JS. So I try to do it the same way I create a new image, like: obj = new Image() I write obj = new HTMLVideoElement(). However this doesn't work. I get the runtime error: Object doesn't support this action. What is wrong? Thanks.

I am trying to create a new HTML5 video elemnt entirely throught JS. So I try to do it the same way I create a new image, like: obj = new Image() I write obj = new HTMLVideoElement(). However this doesn't work. I get the runtime error: Object doesn't support this action. What is wrong? Thanks.

Share Improve this question asked Jul 24, 2012 at 8:52 LightLight 1,6773 gold badges23 silver badges39 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 18

The Image class is a special case.

The standard way to create any arbitrary HTML element is this:

var obj = document.createElement('video');
发布评论

评论列表(0)

  1. 暂无评论