Javascript examples for CSS Style Property:media
Get value from media query
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> @media all and (max-width: 400px), (max-height: 400px) { #some-id {//from w w w . j a v a 2 s .c o m color: red; } } </style> <script type="text/javascript"> window.onload=function(){ document.getElementsByTagName('head')[0].style.display = 'block'; document.getElementsByTagName('style')[0].style.display = 'block'; } </script> </head> <body> </body> </html>