Page switching

I'm switching pages by switching between
display:none
and
display:block
.
How can i stay on the active page even if I refresh?

Can I know what is the best practice for production, please?

https://codepen.io/ahad4387/pen/rNvEPoG
Was this page helpful?