If anyone is interested, they can change it to dynamic loading data, or use jquery, and the code will certainly be much less! I found that adding some css makes this tree useful on static pages!
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ptml xmlns = "http://www.w3.org/1999/xhtml"> <pead> <style type = "text/ css ">. expand {cursor: pointer ;}. hide {cursor: pointer ;}</style> </pead> <body> the definition list can also be changed to a tree: <dl id = "tree"> <dt> menu 1 </dt> <dd> 1.1 aaa </dd> <dd> 1.2 bbb </dd> <dd> 1.3 ccc </dd> <dt> menu 2 </dt> <dd> 2.1 Hello </dd> <dd> hyperlink </dd> <dt> menu 3 </dt> <dd> <dl style = "margin-top: 2px; margin-bottom: 2px; "> <dt> 3.1 </dt> <dd> Baidu news </dd> <dd> Sohu news </dd> <dt> 3.2 </dt> <dd> Baidu news </dd> <dd> Sohu news </dd> </dl> </body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]