JavaScript Reference/Javascript Properties/selector — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 11:21, 26 мая 2010
"selector" Example
<source lang="javascript">
<html> <body> <style> @page:first { background-color: red } @page:left { background-color: blue } @page:right { background-color: orange } </style> <script language="JavaScript">
function function1() { var m = document.styleSheets[0].pages[1]; var n = m.selector; alert(n); }
</script> <input type="button" value="Click here" onclick="function1();"> </body> </html>
</source>
"selector" is applied to
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Applied_To |page | +----------------+--------------------------------------------------------------+
</source>
"selector" Syntax and Note
<source lang="javascript">
Note: Read-only property. Returns the set of pages an @page rule applies to.
Syntax:
document.styleSheets[index1].pages[index2].selector
</source>