Web StyleElement API | StyleElement media property Last Updated : 31 Jul, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report In Web API there are style elements which have media attribute. To fetch this media attribute we use HTMLStyleElement.media property, which specifies the intended destination medium for style information. Syntax: label = style.media style.media = label label is a string which describes a single medium or a comma-separated list. Example: get the media attribute html <!DOCTYPE html> <html> <head> <title> StyleElement media property </title> <style> a:focus { background-color: magenta; } </style> <link id="Link" rel="stylesheet" type="text/css" media="screen" /> <script type="text/javascript"> function getmedia() { var label = document.getElementById('Link'); document.getElementById( 'media').innerHTML = label.media; } </script> </head> <body> <center> <h1 style="color:green;"> GeeksForGeeks </h1> <h2>HTML StyleElement media property</h2> <button onclick="getmedia();" id="btn">Get media</button> <p id='media'></p> </center> </body> </html> Output: Click the button: When the button is clicked: Supported Browsers: Google Chrome Edge 12 Internet Explorer Firefox Safari Opera Comment More infoAdvertise with us Next Article Web HTMLCanvasElement API | Canvas Element width property D DeepakDev Follow Improve Article Tags : Web Tech Web-API Similar Reads Web HTMLStyleElement API | StyleElement type property In Web API there are style elements which have a type attribute. To fetch this type attribute we use HTMLStyleElement.type property, which returns the type of the current style. Syntax: getType = style.type; Example: get the type attribute. html <!DOCTYPE html> <html> <head> <st 1 min read Web API HTMLBodyElement.background property The HTML BodyElement.background property is used to returns a DOMString that represents the description of the location of the background image resource. Syntax: BodyElement.background Return Value: This property returns a DOMString that represents the description of the location of the background i 1 min read Web API Media Session Web API Media Session is a powerful JavaScript feature that allows web developers to take control of media playback within their applications. By using it you can customize media notifications. It provides different actions by which you can control media playback and provide its metadata. Web API In 3 min read Web HTMLCanvasElement API | Canvas Element width property In Web API there is a canvas element which has an attribute of width which represents the width of the canvas in CSS pixels. There is a HTMLCanvasElement.width property by which we can fetch this width attribute from canvas element, which is a positive integer. Syntax: var widthVal = canvas.width; c 2 min read Web ImageData API | ImageData.width property The ImageData.width property used to return the width attribute of ImageData object. The ImageData() is used to create an object of given size. Syntax: imageData.width Example: html <!DOCTYPE html> <html> <head> <title> Web ImageData API | ImageData.width property </title 1 min read Web API DOMRect width property In Web API there is a DOMRectReadOnly Interface which has a property width that gives us the width of the DOMRect object. Syntax: let recX = DOMRect.width; Return Type: Double value Example: Getting the width of the DOMRect object created. HTML <!DOCTYPE html> <html> <head> <tit 1 min read Like