2 years ago

jQuery save toggleClass in localStorage

Posted 2 years ago by Rainieren

Hello, I made a sidebar and I want to save the status of the sidebar for users. If they choose to pick the "Collapsed" version of the sidebar, If they refresh the page the sidebar still stays that way. I know I can use localStorage with this but I don't know how.


$(document).ready(function() {

    $('#sidebar-toggler').on('click', function() {


How can I achieve the above? Thanks in advance

Please sign in or create an account to participate in this conversation.