Style counterIncrementProperty

Style 对象参考手册Style Object

Example

Change the counterIncrement property:

document.getElementById("myH1").style.counterIncrement = "subsection";

Try it Yourself »

Definition and Usage

The counterIncrement property increments the value of one or more counters.

The counterIncrement property is usually used together with the counterReset property and the content property.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the counterIncrement property.

Note:IE8 supports the counterIncrement property only if a !DOCTYPE is specified.


Syntax

Return the counterIncrement property:

object.style.counterIncrement

Set the counterIncrement property:

object.style.counterIncrement="none|id|initial|inherit"

Property Values

Value Description
none Default value. No counter will be incremented.
id number idDefines which counter should be incremented.numberSets how much the counter should be incremented each time the selector occurs. The default increment is 1. 0 or negative values are allowed. Ifidthe referenced counter is not initialized by counter-reset, the default initial value is 0.
initial Sets this property to its default value. Seeinitial。
inherit Inherits this property from its parent element. Seeinherit。

Technical Details

Default Value: none
Return Value: A string, representing the element's counter-increment property.
CSS Version CSS2


Style 对象参考手册Style Object

Other Extensions