-
Build a dynamic TOC by retrieving h2 ID's and then set anchor link (innerHTML, textContent, Template Literals)
-
Missing IDS are intentionnally set in, so I added function to set custom ID's base on the title of the h2 thanks to object keys (replaceAll(' ', '-').toLowerCase())
-
User can generate a title for the story with the input (parentElement, nextElementSibling, createElement)
VanillaJS, CSS, HTML