thinkswell / javascript-mini-projects

Awesome Collection of amazing javascript mini-projects.
The Unlicense
1.15k stars 837 forks source link

Add my project #1079

Closed LakshyaMalik closed 5 months ago

LakshyaMalik commented 8 months ago

Developer Checklist

Summary

I used JavaScript DOM Manipulation to perform this task.

first i created a container and styled everything by setting up off bulb image and toggle button svgs then i creating an onclick event for the button. which triggers the ToggleBulb() function the function stores the image source in a variable Bulb and then compares it using match operator to know whether the image is of bulb on or bulb off and then changes the source using setAttribute accordingly.

Screenshot

attach screenshots/gifs here

Screenshot 2023-10-29 190312 Screenshot 2023-10-29 190329

Live Project Link

add a working project link here

https://bulb-on-off-js-miniproject-2k5y1sno4-lakshyamalik.vercel.app/