Can somebody help me? I just want to make sure that when the value is selected it is saved in the browser, whether it will be restarted or refreshed. For example, I choose "Sticky" and it will remain so until I choose "Absolute". When I choose "Absolute" it will remain so until I choose "Sticky," just to keep the selected value saved. I tried many codes and scripts, but unsuccessfully. I would be very grateful if you help me.
My code:
My code:
Code:
<div id="menu-sticky-right">
<img style="cursor: pointer;" onclick="myFunction()" src="https://i.imgur.com/Ed3FO1w.png" width="15" height="15">
<img style="cursor: pointer;" onclick="myFunction2()" src="https://i.imgur.com/MDg7ZDp.png" width="15" height="15">
<script>
function myFunction() {
document.getElementById('menu-sticky').style.cssText = 'position: absolute;';
}
</script>
<script>
function myFunction2() {
document.getElementById('menu-sticky').style.cssText = 'position: fixed;';
}
</script>
</div>