💻 Day 16— Coder Army | JavaScript Project Today I created a Background Color Changer App using pure HTML, CSS, and JavaScript 🎨 In this project, I used Event Delegation — a JavaScript technique that allows handling all button clicks with just one event listener 👇 Whenever you click a color button, the entire page background changes to that color instantly 💡 🧠 Key Learnings: DOM Selection using getElementById() and querySelector() Event Handling using addEventListener() Event Object & event.target to detect which button was clicked Dynamic Style Change using style.backgroundColor ⚙️ Core JS Code: const parent = document.getElementById('parent'); parent.addEventListener('click', (event) => { const child = event.target; const body = document.querySelector('body'); body.style.backgroundColor = child.id; }); This small project helped me understand how one event listener can manage multiple elements efficiently 🧠✨ 💬 Simple logic, great learning — that’s the power of JavaScript + Coder Army practice 💪 #CoderArmy #JavaScript #Day17 #MiniProject #WebDevelopment #CodingJourney #LearnByDoing #RohitNygi

To view or add a comment, sign in

Explore content categories