About 582,000 results
Open links in new tab
  1. using javascript to make a light switch - Stack Overflow

    Mar 2, 2015 · function lightSwitch(){ var light = document.getElementById("lightSwitch"); var BGcolor = document.body.style.backgroundColor; if (BGcolor != "black"){ light.innerHTML = …

  2. GitHub - rahulsi737/Glowing-Bulb: Simple project simulating a light ...

    This project is a simple HTML, CSS, and JavaScript implementation that simulates turning a light on and off. The interface includes a light bulb, a switch, and accompanying animations.

  3. Simple Traffic Light implementation using Javascript

    In this article, I will illustrate a simple usage of JavaScript to display a Traffic Light Signal on the web page. This code demo can be used for implementing simple school and college projects. …

  4. Turning on a Light with JavaScript | by Paul Otto | Medium

    Sep 3, 2024 · I used Matter’s open-source JavaScript code to control a light with a Raspberry Pi (RPi) and the Google Home app. This is part 1 of a series on home automation with Matter.

  5. Making a Toggle Switch with Web Components - Auroratide

    Sep 24, 2021 · Let's build the toggle switch element as a web component using the humble light bulb to guide our thinking.

  6. How to create a Light Toggle Switch in CSS & Javascript

    Oct 31, 2022 · Learn with us how to create a Light Toggle Switch in CSS & Javascript! If you found us on TikTok on the following post, check out this article and copy-paste the full code! …

  7. javascript - Turning lights on and off - Stack Overflow

    Nov 16, 2015 · In JavaScript, event handlers get a special variable called this, which refers to the element from which the event was fired (in this case the light bulb that was clicked), you can …

  8. light on/off - simple javascript - CodePen

    $('#switch').click(switchClick); function switchClick(){ var x = $("#switch").val(); if(x == 'on') { $('#lightImg').attr('src','https://www.w3schools.com/js/pic_bulbon.gif'); …

  9. Create a Super Simple Light/Dark Mode Switch - DEV Community

    Jul 7, 2021 · Luckily a dark mode switch is very easy to implement with a few lines of JavaScript and some CSS custom properties. First of all, we need to think about the technical …

  10. A creative and interactive light bulb animation with a switch, built ...

    This project showcases a visually appealing light bulb animation with a switch. The animation is achieved through a combination of HTML, CSS, and JavaScript, providing an interactive …

Refresh