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
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.