I’m using this code to below and trying to keep the url from changing.
<A HREF="javascript:(function(){document.cookie = `splnu=0;domain=${window.location.hostname};`; location.href = `${_spPageContextInfo.webServerRelativeUrl}/_layouts/15/viewlsts.aspx`;})();">Classic</A>