刷新网页后,如何保持活动标签处于打开状态。我使用了bootstrap(w3school)代码;
<script>
var acc = document.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc.length; i++) {
acc[i].onclick = function() {
this.classList.toggle("active");
var panel = this.nextElementSibling;
if (panel.style.maxHeight){
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
}
}
}
</script>
HTML
<button class="accordion"><div class="panel-heading">Application Usages</div></button>
谢谢