When i do a page postback the div closes and i no longer able to open div again on button click ?
I have included relevant code for your convenience.
<asp:Button ID="Button2" runat="server" OnClientClick=";return false;" Text="Click to open Basket" class="collapsible"/>
**<div id="divbasket" class="content" runat="server">
content
</div>**
.content {
padding: 0 18px;
max-height: 0px;
overflow: hidden;
transition: max-height 0.2s ease-out;
background-color: #f1f1f1;
}
<script>
var coll = document.getElementsByClassName("collapsible");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function () {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.maxHeight) {
content.style.maxHeight = null;
} else {
content.style.maxHeight = content.scrollHeight + "px";
}
});
}
</script>