Creates a table of contents in a DOM element optionally linked to with anchors. No dependencies.
We're on npm:
npm i html-contents
Download from GitHub: https://github.com/psalmody/html-contents
No jQuery needed. Just include this script:
And call like this.
Optionally put some options in there:
//these are the defaultsdocument
You can run
localhost:3000 to see a working example (it's also in