NBash
13 строк · 373.0 Байт
1
2const imageToggle = document.getElementById('imageToggle')3const darkImage = document.getElementById('darkimage')4const lightImage = document.getElementById('lightimage')5
6if (imageToggle) {7imageToggle.addEventListener('change', () => {8if (imageToggle.checked) {9darkImage.style.width = '100%';10} else {11darkImage.style.width = '0%';12}13})14}
15
16