HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> p::before{ counter-increment: myCounter; content: "Paragraph " counter(myCounter) ": "; font-weight:bold; font-size:17px; } </style> </head> <body> <h1>CSS counter-reset Property</h1> <p>This is paragraph</p> <p>This is paragraph</p> <p>This is paragraph</p> <button onclick="myFunction()">Click Me</button> <script> var x = document.getElementsByTagName("body")[0]; function myFunction(){ x.style.counterReset = "myCounter"; } </script> <p><strong>Note</strong>: Click on the button to add css 'counter-reset' property.</p> </body> </html>
OUTPUT
×

Save as Private