Learn how to create a real working bulb switch using just HTML, CSS, and JavaScript — a fun and simple project perfect for beginners!
📖 About This Project
This project allows you to turn a bulb image on and off by clicking a button. It’s a basic use of JavaScript's onclick
event to manipulate HTML elements — ideal for absolute beginners who want to get hands-on with real interactivity.
onclick
event to manipulate HTML elements — ideal for absolute beginners who want to get hands-on with real interactivity.🔧 Features You'll Learn:
Handling button clicks using onclick
Changing image sources (img.src
) with JavaScript
Structuring a responsive layout with HTML & CSS
Making your very first functional web interaction
🎥 Watch the Video Tutorial
💾 Source Code :
🧱 HTML Structure:
🎨 CSS Styling:
⚡ JavaScript Code:
🙌 Final Words
This is the kind of small, fun project that helps build confidence when you're learning JavaScript. Try it yourself and see how easily you can control HTML elements with just a few lines of code.
📺 Subscribe for More
If you liked this project, be sure to subscribe to my YouTube channel for more beginner tutorials and creative UI projects!
Follow me on Github
Join our WhatsApp Channel
🏷️ Tags:
Bulb on off using JavaScript, beginner JavaScript project, JavaScript image toggle, bulb project HTML CSS, how to make bulb switch in JavaScript
0 Comments