Source Code: (back to article)
<!DOCTYPE html>
<html>
<head>
<title>Der Titel des Dokuments</title>
<style>
h2::before {
counter-increment: section;
content: "Book " counter(section) ". ";
}
</style>
</head>
<body>
<p>Klicken Sie auf die Schaltfläche "Jetzt testen", um die Eigenschaft counter-reset einzustellen:</p>
<button onclick="myFunction()">Jetzt testen</button>
<h2>HTML Tutorials</h2>
<h2>JavaScript Tutorials</h2>
<h2>CSS Tutorials</h2>
<script>
function myFunction() {
document.body.style.counterReset = "section";
}
</script>
</body>
</html>