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

HTML DOM Style counterReset Property

Style counterReset Property

Style Object Reference The Style object

Example

Change the counter-reset property:

document.body.style.counterReset = "section";

Try it »


Definition and Usage

The counterReset property creates or resets one or more counters.

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


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the counterReset property.

**Note:** IE8 only supports the counterReset property when a !DOCTYPE is specified.


Syntax

Return the counterReset property:

object

.style.counterReset

Set the counterReset property:

object

.style.counterReset="none|

name number

|initial|inherit"

Attribute values

Value Description
none Default value. No counter will be reset.
name name Defines which counter should be reset.
number id Defines which counter should be reset.number Sets the value that the counter should be set to each time the selector occurs. The default reset 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