http://stackoverflow.com/questions/187619/is-there-a-javascript-solution-to-generating-a-table-of-contents-for-a-page 遇到一个更小的新标签,直接创建新的UL不用加到父节点中。

Table of Contents


Fruits

Red Fruits

Apple

444444

555555555555

Raspberry

Orange Fruits

Orange

Tangerine

Vegetables

Vegetables Which Are Actually Fruits

Tomato

Eggplant