JavaScript Reference/Javascript Properties/selectorText — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 11:21, 26 мая 2010
"selectorText" Example
<source lang="javascript">
<html> <body> <style>
- myP { font-family:verdana, arial; }
</style> <script language="JavaScript">
function function1() { alert(document.styleSheets[0].rules[0].selectorText); }
</script>
Sample text.
<input type="button" value="Selector Text" onclick="function1()"> </body> </html>
</source>
"selectorText" is applied to
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Applied_To |page rule | +----------------+--------------------------------------------------------------+
</source>
"selectorText" Syntax and Note
<source lang="javascript">
Note: Read and write property. Specifies the selector of the style sheet rule. The selector is either the element id or the element tag name.
Syntax:
document.styleSheets[index1].rules[index2].selectorText = value
</source>