const widthBtn = document.getElementById('changeWidthBtn'); const articleElem = document.getElementsByTagName('article')[0]; if (localStorage.getItem('width') === 'wide') { widthBtn.innerHTML = 'Narrow
article'; articleElem.classList.add('noMaxWidth'); } widthBtn.onclick = function() { articleElem.classList.toggle('noMaxWidth'); if (localStorage.getItem('width') !== 'norm') { widthBtn.innerHTML = 'Wide
article'; localStorage.setItem('width', 'norm'); } else { widthBtn.innerHTML = 'Narrow
article'; localStorage.setItem('width', 'wide'); } }