Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style counterIncrement Property

Style counterIncrement Property

Style Object Reference The Style object

Example

Change the counterIncrement property:

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

Try it »


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 only supports the counterIncrement property when a !DOCTYPE is specified.


Syntax

Return the counterIncrement property:

object

.style.counterIncrement

Set the counterIncrement property:

object

.style.counterIncrement="none|

id

|initial|inherit"

Attribute values

Value Description
none Default value. No counter will be incremented.
id number id Defines which counter should be incremented.number Sets how much the counter should be incremented each time the selector occurs. The default increment value is 1. Values of 0 or negative are allowed. If id the referenced counter has not been initialized by counter-reset, then the default initial value is 0.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default value: none
Return Value: A string that represents the counter-increment property of an element.
CSS version CSS2

Style Object Reference The Style object