X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM Source Object


Source Object

The Source Object is new in HTML5.

The Source object represents an HTML <source> element.

Access a Source Object

You can access a <source> element by using getElementById():

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

Create a Source Object

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

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

Source Object Properties

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

Standard Properties and Events

The Source object also supports the standard properties and events.


Related Pages

HTML tutorial: HTML5 Video

HTML tutorial: HTML5 Audio

HTML reference: HTML <source> tag



Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook