Style counterIncrement attribute
- Previous Page columnWidth
- Next Page counterReset
- Go to the Previous Level HTML DOM Style Object
Definition and usage
counterIncrement
attribute sets the increment of the counter each time a selector appears. The default increment is 1.
counterIncrement
The attribute is usually used with the counterReset attribute and the content attribute.
Example
Change counterIncrement attribute:
document.getElementById("myH1").style.counterIncrement = "subsection";
Syntax
Return counterIncrement attribute:
object.style.counterIncrement
Set counterIncrement attribute:
object.style.counterIncrement = "none|id number|initial|inherit"
Attribute value
Value | Description |
---|---|
none | Default value. Does not increment any counter. |
id | Defines the counter that should be incremented. |
id number |
Sets how much the counter will increase each time the selector appears. The default increment is 1. Allows the use of 0 or negative values. If the id refers to a counter that has not been initialized with counter-reset, the default initial value is 0. |
initial | Set this attribute to its default value. See initial. |
inherit | This attribute inherits from its parent element. See inherit. |
Technical details
Default value: | None |
---|---|
Return value: | string representing the element's counter-increment attribute. |
CSS Version: | CSS2 |
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |
- Previous Page columnWidth
- Next Page counterReset
- Go to the Previous Level HTML DOM Style Object