HTML – How to Turn-On and Off the Light

 | Uncategorized


<!DOCTYPE html>
function changeImage() {
var image = document.getElementById(‘bulb’);
if (image.src.match(“bulb-on”)) {
image.src = “”;
} else {
image.src = “”;
</script><div class=”switchbutton” style=”display: block; position: absolute; margin-top: 250px; margin-left: 60px;”>
<img src=””
style=”position: absolute; margin-top:; margin-left:; “>
<button onclick=”changeImage()” style=”position: absolute; margin-top: 35px; margin-left: 31px;
width: 30px; height: 35px;”></button>


<img id=”bulb” src=””
style=”height: 200px; margin-left: 220px; margin-top: 180px; position: absolute;”>