Style counterResetProperty
Example
Change the counter-reset property:
document.body.style.counterReset = "section";
Try it Yourself »
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
![]()
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"
Property Values
| Value | Description |
|---|---|
| none | Default value. No counters will be reset. |
| name | nameDefines which counter should be reset. |
| number | idDefines which counter should be reset.numberSets the value the counter should be set to on each occurrence of the selector. The default reset 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 counter-increment property of the element. |
| CSS Version | CSS2 |
Other Extensions
Style Object