Latest web development tutorials

HTML DOM Style counterReset property

Style Object Reference Style Objects

Examples

Changing the counter-reset property:

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

try it"

Definition and Usage

counterReset property create or reset one or more counters.

counterReset property is often used in conjunction with counterIncrement attributes and content attributes.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support counterReset property.

Note:! Only when you specify a DOCTYPE when, IE8 is supported counterReset property.


grammar

Back counterReset properties:

object .style.counterReset

Setting counterReset properties:

object .style.counterReset="none|name number|initial|inherit"

Property Value

描述
none 默认值。没有计数器会被重置。
name name定义了哪一个计数器应被重置。
number id定义了哪一个计数器应被重置。number设置了计数器在选择器每出现一次应设置的值。默认重置值是 0。
initial 设置该属性为它的默认值。请参阅 initial
inherit 从父元素继承该属性。请参阅 inherit

technical details

Defaults: none
return value: String representing the counter-increment property element.
CSS version CSS2


Style Object Reference Style Objects