Is there a JavaScript solution to generating a “table of contents” for a page?

后端 未结 12 1714
广开言路
广开言路 2020-12-12 17:21

I have headers in

through
tags. Is there a way that I can use JavaScript to generate a table of contents for the contents tha

12条回答
  •  天涯浪人
    2020-12-12 18:03

    Here's a great script to do this:

    https://github.com/matthewkastor/html-table-of-contents/wiki

    To use it:

    1. Add this tag:

      
      
                                       
                    
提交回复
热议问题