This question has already been answered:
Hello. I have an element whose property changes when I click on a certain button on the user. Namely, ul to which display: none is assigned. I need this to persist when the page reloads. How to save element style using cookie and jquery?
upd. Probably incorrectly explained the problem, I will give everything with sample code.
$('.odz-toggle').after().next().css("display", "none"); // Π£Π±ΠΈΡΠ°Π΅ΠΌ Π»ΠΈΡΠ½ΠΈΠ΅ Π±Π»ΠΎΠΊΠΈ $(".odz-toggle").click(function () { $(this).closest('li').siblings().find('div').slideUp('normal'); $(this).next('ul').slideToggle('normal'); }); // ΠΎΡΠΊΡΡΠ²Π°Π΅ΠΌ Π½ΡΠΆΠ½ΡΠΉ Π±Π»ΠΎΠΊ ΠΏΡΠΈ Π½Π°ΠΆΠ°ΡΠΈΠΈ Π½Π° ΠΊΠ½ΠΎΠΏΠΊΡ The position of the desired ul'a (open or closed) must be stored in a cookie.