Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Source Object

HTML DOM Source Object


The Source object

The Source object is new in HTML5.

The Source object represents an HTML .

Access the Source Object

You can use getElementById() to access it element:

var x = document.getElementById("mySource");

Try it

Create the Source Object

You can use the document.createElement() method to create element:

var x = document.createElement("SOURCE");

Try it

Source Object Properties

property Description
media Sets or returns the the value of the media attribute in the element.
src Sets or returns the the value of the src attribute in the element.
type Sets or returns the the value of the type attribute in the element.

Standard properties and events

The Source object also supports standard property and Events.


Related Articles

HTML Tutorial:HTML5 Video

HTML Tutorial:HTML5 Audio

HTML Reference Manual:HTML tag