MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / turnOnOff

Function turnOnOff

assets/js/bulb.js:1–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1function turnOnOff() {
2 var image = document.getElementById('Image');
3 var Switch= document.getElementById('Switch');
4
5 if (image.src.match("RHIGZ"))
6 {
7 Switch.src="https://cdn.pixabay.com/photo/2012/04/16/13/27/switch-36000__340.png";
8 image.src = "https://t4.ftcdn.net/jpg/00/51/20/61/240_F_51206163_eQGOsejUkqB13Y519PKhKVxwqRonQxiu.jpg";
9 }
10 else
11 {
12 Switch.src="https://cdn.pixabay.com/photo/2012/04/18/13/25/light-switch-37017__340.png"
13 image.src = "https://t4.ftcdn.net/jpg/00/51/20/61/240_F_51206166_RHIGZE9tHv5v5nhgktJJOJLSzMZvU85m.jpg";
14 }
15}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected