Hello, rookie here. i am using basic javascript, css to open/close div by clicking/unclicking on checkbox.
function toggleMenu (divId, box) {
var vis = (box.checked) ? "block" : "none";
document.getElementById(divId).style.display = vis;
}
how do i keep the state of the javascript effect. right now if i click on checkbox to open the div and if i refresh the page or hit back, the page would load with checked box but closed div.
many thanks in advance.