/* This defines a function which turns off every light by removing the "on" class from the HTML elements.*/

var TERMS = document.getElementsByClassName("term");

function allOff() {
  for (var i=0; i<TERMS.length; i = i+1) {
    TERMS[i].classList.remove("on");
  }
}

/* This defines a function which first turns off every light and then immediately turns one on.*/
function switchTerm(termNumber) {
  allOff();
  var term = TERMS[termNumber];
  term.classList.add("on");
}
@@ -1,28 +1,29 @@
+%0A
 /* This defines a function w
@@ -264,16 +264,171 @@
 %0A  %7D%0A%7D%0A%0A
+/*var ID = document.getElementByID(%22program%22);%0A%0A#function allOff() %7B%0A # for (var i=0; i%3CID.length; i = i+1) %7B%0A  #  ID%5Bi%5D.classList.remove(%22on%22);%0A  #%7D%0A#%7D/*%0A
 /* This 
@@ -623,9 +623,30 @@
 (%22on%22);%0A
-
 %7D
+%0Aconsole.log(TERMS);%0A

Update lights.js