yogeshptl wrote:
You used an attribute 'visible' here. If you use that and set it to false then it would not be present in the page anymore and thus Javascript wont be able to find it.
Instead use 'display' attribute.
<div style="display:none">
This will keep the control on page and accessible in Javascript.
For toggling the value of display try:
var divs = document.getElementById ("treelist");
divs.style.display = "block";
divs.style.display = "none";