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.
1 Answer
Reset to default 18The Image
class is a special case.
The standard way to create any arbitrary HTML element is this:
var obj = document.createElement('video');