This article mainly introduces the implementation of the javascript drop-down list menu, which is encapsulated by table. We know that after each row of the table is full, the next row will be automatically added, complete code is included at the end of the article. If you need it, you can refer to the "Implementation of tree menu display in the javascript drop-down list" menu, but after writing it, I found out that it is not suitable. It requires high precision control and is not very nice. Now we use table as the encapsulation. We know that when each row of the table is full, the next row will be automatically added, which is much better than we did before.
1. After clicking the button, you can coexist (you only need to write different functions)
Dispaly is also set by itself. The parent node is used to operate the child node, and whether the child node is displayed or not;
/* Function open1 (node) {// operate the sibling node through the parent node. After clicking the node, the node can be opened directly. However, when you open a node, all others turn off var nodes = node. parentNode; var nn = nodes. getElementsByTagName ("ul") [0]; with (nn. style) {display = (display = "block ")? "None": "block" ;}}*/script
2. Only one click is allowed, and all others must be disabled.