How to create a hierarchy with numbers in the table of contents jquery?
I have a subheading structure: <h2>Red Fruits</h2> <h3>Apple</h3> <h3>Raspberry</h3> <h2>Orange Fruits</h2> <h3>Orange</h3> <h3>Tangerine</h3> <h2>Vegetables Which Are Actually Fruits</h2> <h3>Tomato</h3> <h3>Eggplant</h3> The script automatically creates a table of contents: https://jsfiddle.net/voxtermen/t5nkjbvo/2/ The result looks like this: 1. Red Fruits 2. Apple 3.…