I want to share some of the things I learned today.
Similar to the TreeMenu control.
Code without nonsense:
Copy codeThe Code is as follows:
<Script language = "javascript">
Function control () {// define a function
If (sMenus3.innerHTML = "+") {// determine the expansion status
UlMenu3.style. display = "block"; // if the number is "+", expand
SMenus3.innerText = "-"; // After expansion, it is displayed as a minus sign.
}
Else {
UlMenu3.style. display = "none"; // if it is a hyphen (-), it cannot be expanded.
SMenus3.innerText = "+"; // The symbol is changed after you click it.
}
}
</Script>
Html code:
// The main difference between this code is that the Id corresponds to the Id in the js Code.
Copy codeThe Code is as follows:
<Body>
<Span id = "sMenus3" style = "border: 1px solid #00000; color: Blue; cursor: hand;" onclick = "control () ">-</span> no website status <br/>
<Ul id = "ulMenu3">
<Li> <a href = "http://www.baidu.com" target = "_ blank"> Baidu </a> </li>
<Li> <a href = "http://www.baidu.com" target = "_ parent"> Baidu </a> </li>
<Li> <a href = "http://www.baidu.com" target = "_ blank"> or Baidu </a> </li>
</Ul>
</Body>