Easy Tutorial
❮ Jsref Encodeuri Prop Attr Name ❯

HTML DOM Source Object


Source Object

The Source object represents an HTML <source> element.

Accessing a Source Object

You can use getElementById() to access a <source> element:

Creating a Source Object

You can use the document.createElement() method to create a <source> element:

Source Object Properties

Property Description
media Sets or returns the value of the media attribute in the <source> element.
src Sets or returns the value of the src attribute in the <source> element.
type Sets or returns the value of the type attribute in the <source> element.

Standard Properties and Events

The Source object also supports standard properties and events.


Related Articles

HTML Tutorial: HTML5 Video

HTML Tutorial: HTML5 Audio

HTML Reference: HTML <source> Tag

❮ Jsref Encodeuri Prop Attr Name ❯