Anonymous Anonymous - 1 year ago
715 0

Trying to create an automated traffic light sequence... I dont want to create it with CSS, I already have a working set of picture code - probably found on a post on here. Please help!


Automated Traffic Light Sequence

<!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