There are a few approaches you can take to prevent the reset of a hide/show div on page refresh:
Use localStorage or sessionStorage to store the state of the hide/show div. When the page loads, check if there is a stored value and use that to determine whether to hide or show the div.
Use cookies to store the state of the hide/show div. When the page loads, check if there is a cookie set and use that to determine whether to hide or show the div.
Use server-side scripting to retrieve the state of the hide/show div from a database or session variable. This approach requires server-side programming knowledge and may be more complex, but it allows you to store the state of the div across multiple visits to the page.
Asked: 2021-06-28 11:00:00 +0000
Seen: 11 times
Last updated: Jul 02 '21