最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

rules Collection

Internet Development Index

Retrieves a collection of rules defined in a style sheet.

Syntax

[ oColl = ] styleSheet.rules
[ oObject = ] styleSheet.rules(iIndex)

Possible Values

oCollArray of rules.
oObjectReference to an individual item in the array of elements contained by the object.
iIndexRequired. Integer that specifies the zero-based index of the item to be returned.

Members Table

PropertyDescription
length Sets or retrieves the number of objects in a collection.
MethodDescription
item Retrieves an object from the rules collection.

Remarks

This collection is always accessible, even if the style sheet is not enabled. Rules are added to the rules collection with the addRule method on the individual style sheet. A rule that is added to a disabled style sheet does not apply to the document unless the style sheet is enabled. Rules are deleted with the removeRule method.

The rules in this collection are in the source order of the document. As rules are added or deleted through the Cascading Style Sheets (CSS) Object Model, a rule's absolute position in the rules collection might change, but its position relative to other rules remains the same. When you add rules without specifying an index, the rule gets added to the document last. If you specify an index, however, the rule is inserted before the rule currently in that ordinal position in the collection. If the specified index is greater than the number of rules in the collection, the rule is added to the end.

Example

This example shows how to use the rules collection to identify the color specified in style sheet rules.

<HTML>
<HEAD>
<SCRIPT>
function ruleColor(ruleIndex) {
alert("The color of rule " + ruleIndex + " is " +
document.styleSheets[0].rules.item(ruleIndex).style.color + ".");
}
</SCRIPT>
<STYLE>
.rule0 {color:"red"}
.rule1 {color:"blue"}
</STYLE>
</HEAD>
<BODY>
<P class="rule0" id="oRule0Span">
Rule 0 is applied to this line.
</P>
<P class="rule1" id="oRule1Span">
Rule 1 is applied to this line.
</P>
<BUTTON onclick="ruleColor(0)">Color of Rule 0</BUTTON>
<BUTTON onclick="ruleColor(1)">Color of Rule 1</BUTTON>
</BODY>
</HTML>
This feature requires Microsoft® Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

This collection is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 Non-Microsoft link.

Applies To

styleSheet
蓝山县| 凉城县| 冷水江市| 崇义县| 罗甸县| 安顺市| 宾阳县| 治县。| 辽阳市| 通河县| 吴忠市| 体育| 克拉玛依市| 喀什市| 阳泉市| 永善县| 闵行区| 星座| 武穴市| 克山县| 茂名市| 隆安县| 台江县| 北辰区| 鄂尔多斯市| 贺州市| 长兴县| 郴州市| 吉木乃县| 文安县| 陆川县| 松潘县| 旬阳县| 镇安县| 江安县| 百色市| 巴楚县| 虎林市| 达拉特旗| 霍城县| 石首市|