Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML | DOM Style counterReset Property

Improve Article
Save Article
Like Article
  • Last Updated : 13 Jul, 2022
Improve Article
Save Article
Like Article

The Style counterReset property in HTML DOM is used to create or reset counters. This property is used with the counterincrement property and the content property.

  • It is used to return the counterReset property.
  • It is used to set the counterReset property. = "none|name|number|initial|inherit"

Property values 

Value Description
none It is the default value no counter will be reset.
name It holds the name of the counter which counter will be reset.
number It holds the number which counter will be reset.
initial Set this property to it’s default value.
inherit Inherits the property from it’s parent element.

Return Value:This method returns a string containing counter-increment property of element.


<!DOCTYPE html>
        HTML DOM Style counterReset Property
        p:before {
            counter-increment: subj;
            content: "Subject " counter(subj) ": ";
        HTML DOM Style counterReset Property
    <button onclick = "myFunction()">
        Click Here!
    <h2>Computer Science Subjects</h2>
    <p>Data Structure</p>
    <p>Operating System</p>
    <p>Computer Networks</p>
        function myFunction() {
   = "subj";

Before click on the button: 

After click on the button: 

Supported Browsers: The browser supported by DOM counterReset property are listed below: 

  • Google Chrome 2
  • Edge 12
  • Internet Explorer 8
  • Firefox 1
  • Opera 9.2
  • Safari 3


My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!