└── Bulb-on-off
├── img
├── bulb-off.avif
└── bulb-on.avif
├── index.html
├── index.js
└── style.css
/Bulb-on-off/img/bulb-off.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Bipan101/BulbOnOff-via-js/c26aa0464e646017a1b34a98102dd9e0dfc54c66/Bulb-on-off/img/bulb-off.avif
--------------------------------------------------------------------------------
/Bulb-on-off/img/bulb-on.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Bipan101/BulbOnOff-via-js/c26aa0464e646017a1b34a98102dd9e0dfc54c66/Bulb-on-off/img/bulb-on.avif
--------------------------------------------------------------------------------
/Bulb-on-off/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Bulb-On-Off
7 |
8 |
9 |
10 |
11 |
12 | Simple Demonstration of JS functionalitiy.
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Bulb-on-off/index.js:
--------------------------------------------------------------------------------
1 | let a = document.getElementById('bulboff');
2 | let b = document.getElementById('btn1');
3 | let c = document.getElementById('btn2');
4 | b.addEventListener('click', function()
5 | {
6 | a.src="./img/bulb-on.avif";
7 | // if(a.src.match('blub on')){
8 | // b.style.backgroundColor="blue";
9 | // b.style.color="white";
10 | // }
11 | });
12 | c.addEventListener('click', function()
13 | {
14 | a.src="./img/bulb-off.avif";
15 | });
16 |
--------------------------------------------------------------------------------
/Bulb-on-off/style.css:
--------------------------------------------------------------------------------
1 | #bulboff
2 | {
3 | height: 200px;
4 | width: 200px;
5 | }
6 |
--------------------------------------------------------------------------------