m.roe m.roe - 1 year ago
851 0

Please, please, please help me! I'm trying to make an automated traffic light system. I don't like coding but I have no option. Picture traffic light system is fine, no CSS please. Please help!


Automated Traffic Light system HELP!

<!DOCTYPE html>

<h1>HELP ME! :) </h1>

<p>This is my Traffic Light script</p>

<img id="light" src="./assets/red.jpg">

<button type="button" onclick="changeLights()">Change Lights</button>

var list = [

var index = 0;

function changeLights() {
    index = index + 1;

    if (index == list.length) index = 0;

    var image = document.getElementById('light');

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download