HTML DOM Source media Property Last Updated : 02 Feb, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The HTML DOM Source media Property is used to set or return the value of the media attribute of the <source> element. The <source> media attribute is used to accept any valid media query that would normally be defined in a CSS. This attribute can accept several values. Syntax: It is used to return the media property. SourceObject.media; It is used to set the media property. SourceObject.media="values"; Possible Operators and: AND operatornot: NOT operatoror: OR operator DEVICES all: Suitable for all devicesaural: Speech synthesizersbraille: Braille feedback deviceshandheld: Handheld devices (small screen, limited bandwidth)projection: Projectorsprint: Print preview mode/printed pagesscreen: Computer screenstty: Teletypes and similar media using a fixed-pitch character gridtv: Low resolution or limited scroll ability type devices like Television. VALUES width: It is used to target the display area’s width.height: It is used to target display area’s heightdevice-width: It is used to Target display or paper’s width.device-height: It is used to Target display or paper’s height.orientation: Target display or paper’s orientation.aspect-ratio Width/height: Ratio of the targeted display area.device-aspect-ratio: Device-width/device-height ratio of the target display/paper.color: Bits per color of the target display.color-index: Number of colors the target display can handle.monochrome: Bits per pixel in a monochrome frame buffer.resolution Pixel: density (dpi or dpcm) of the target display/paper.scan: Scanning method of a tv display.grid: If the output device is grid or bitmap. Return Value: It returns a String value, which represents the indented type of the media resource Example: Below HTML code returns the source media property. HTML <!DOCTYPE html> <html> <head> <style> body { text-align: center; } h1 { color: green; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>HTML DOM Source media property</h2> <audio controls> <source id="mySource" src="gameover.wav" type="audio/mpeg" media="(min-width: 600px)"> <source src="gameover.ogg" type="audio/ogg"> </audio> <p>Click the button to get the media of the source file.</p> <button onclick="myGeeks()"> Get Media </button> <p id="demo"></p> <script> function myGeeks() { var x = document.getElementById("mySource").media; document.getElementById("demo").innerHTML = x; } </script> </body> </html> Output : Supported Browsers: Google ChromeOperaSafariFirefoxInternet Explorer Comment More infoAdvertise with us Next Article HTML | DOM Video muted Property M manaschhabra2 Follow Improve Article Tags : HTML HTML-DOM HTML-Property Similar Reads HTML DOM Source src Property The Source src Property in HTML DOM is used to set or return the value of the src attribute in a <source> element. The src attribute is used to specify the URL of the media resource. Syntax: It returns the Source src property. sourceObject.srcIt is used to set the Source src property.sourceObj 2 min read HTML DOM Source type Property The Source type Property in HTML DOM is used to set or return the value of the type attribute in a <source> element. The type attribute is used to specify the MIME type of the media resource. Syntax: It returns the Source type property. sourceObject.typeIt is used to set the Source type proper 2 min read HTML DOM Link media Property The HTML DOM link media property is used to set or return the value of the media attribute of an <link> element. The media attribute is used to specify what type of media devices the target resource is optimized. Syntax: It is used to return the media property. linkObject.media; It is used to 1 min read HTML | DOM Video mediaGroup Property The Video mediaGroup property is used for setting or returning the name of the media group the video is a part of. Two or more <video> elements can be synchronized together using a media group. The Video mediaGroup property returns a string which represents the media group of the video. Syntax 2 min read HTML | DOM Video muted Property The Video muted property is used for setting or returning whether the audio output of the video should be muted or not. Syntax: For returning the muted property:videoObject.mutedFor setting the muted property:videoObject.muted = true|false Property Values: true|false: It is used to specify whether t 2 min read HTML | DOM Video src Property The Video src property is used for setting or returning the value of the src attribute of a video. The src attribute is generally used to specify the location (URL) of the video file. Syntax: Return the src property:videoObject.srcSet the src property:videoObject.src = URL Property Values: URL: It i 2 min read Like