Day 2: Modifying Content & Styles
Daily Objective
Section titled “Daily Objective”Update element text, insert markup safely, and manipulate CSS classes via classList.
1. Content & Classes
Section titled “1. Content & Classes”const heading = document.querySelector('h1');heading.textContent = 'Updated via JavaScript';
// classList is preferred over element.styleheading.classList.add('highlight');heading.classList.remove('hidden');heading.classList.toggle('active');Daily Hands-on Practice (70%)
Section titled “Daily Hands-on Practice (70%)”- Build a toggle button that toggles a
.dark-modeclass on the<body>.