1. Headings with Automatic Numbers

This page provides a simple framework in which we can see the use of JavaScript to add numbers to all the headings automatically.

The absence of CSS is deliberate — the aim is to focus on the Markup and scripting.

1.1. Credit

The core script is a slightly modified version of that written by Liam Bennett which he wrote to originally to add heading numbers to Google Docs.

1.2. A Level 2 Subsection

Here's some short text underneath that heading.

1.3. Another Level 2 Subsection

And a bit more text here too, but this one has sub sections!

1.3.1. A Level 3 Subsection

An extremely short subsection.

1.3.2. A Second Level 3 Subsection

An ever shorter one.

2. Summary

A gratuitous use of an h1 heading merely to show another correctly numbered heading.