Link media property
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. |
| 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





All major browsers support the media attribute
Example
Example
The following example gets the media type using the link element:
Try it »
Link Object