JavaScript Reference/Javascript Properties/media
Содержание
"media" Example
<source lang="javascript">
<script language="JavaScript">
function function1() { document.all.myL.media = "print"; }
</script> <a id="myL" href="" onClick="return false" media="screen">Some link</a> <input type="button"
id="myB" onClick="function1();" value="Change the output media to "print"">
</body> </html>
</source>
"media" is applied to
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Applied_To |<link> <style> | | |styleSheet | +----------------+--------------------------------------------------------------+
</source>
"media" Possible Values
<source lang="javascript">
Possible Values screen, print, all (the default).
</source>
"media" Syntax and Note
<source lang="javascript">
Note: Read and write property. Specifies the output device for the object.
Syntax:
document.getElementById("elementID").media = value document.all.elementID.media = value // IE only document.styleSheets[index].media = value
</source>