उदाहरण
counterIncrement प्रॉपर्टी से CSS काउंटर बढ़ाएं।
<!DOCTYPE html>
<html>
<head>
<style>
h2 {
counter-increment: section;
}
h2:before {
content: counter(section) " क्विज़ ";
}
</style>
</head>
<body>
<h1>क्विज़</h1>
<p>counterIncrement बदलें</p>
<h2>रूबी</h2>
<h2 id="myID">जावा</h2>
<h2>PHP</h2>
<h2>पर्ल</h2>
<button onclick="display()">काउंटर इंक्रीमेंट अपडेट करें</button>
<script>
function display() {
document.getElementById("myID").style.counterIncrement = "subsection";
}
</script>
</body>
</html>
उपयोग: counter-increment CSS प्रॉपर्टी के साथ JavaScript से डायनामिकली मान बदलें।