var options = document.getElementById("<%=listbox1.ClientID%>").getElementsByTagName("option");
for(var i = 0;i<options.length;i++)
{
options[i].setAttribute("selected", "");
}
document.getElementById('divlst').style.display = "none";
i have this function called on ok button client click
but its still visible & after clicking ok button eveything in listbox gets selected