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.
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
Click the button:
When the button is clicked:
- Google Chrome
- Edge 12
- Internet Explorer
- Web HTMLStyleElement API | StyleElement type property
- CSS | media queries
- CSS | @media Rule
- Bootstrap | Media queries
- Bootstrap 4 | Media Objects
- Media Objects in Bootstrap with Examples
- How to target desktop, tablet and mobile using Media Query ?
- YouTube Media/Audio Download using Python | pafy
- What is the difference between “screen” and “only screen” in media queries?
- CSS | transition-property Property
- CSS | right Property
- CSS | top Property
- CSS | all Property
- CSS | nav-down property
- CSS | nav-right property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.