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

HTML DOM Link media property

Link media property

Link Object Reference Link Object


Definition and Usage

The media property sets or returns the device on which the document is displayed.

The target medium is very important for style information. The styles of mobile devices and desktop computers may be different.

Syntax

Set the media property:

linkObject.media="

device

"

Return the media property:

linkObject.media

device Can be one of the following values:

Value Description
screen For non-paginated computer screens.
tty For media that use a monospaced character grid (such as typewriters, terminals, or other devices with limited display capability).
tv For TV-type devices.
projection For projectors.
handheld For handheld devices.
print For pages and documents in print preview mode.
braille For braille tactile feedback devices for the blind.
aural For speech synthesis.
all For all devices or equipment.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the media attribute


Example

Example

The following example gets the media type using the link element:

Runoob Tutorial(runoob.com)

Try it »


Link Object Reference Link Object