While the code is functioning properly, I am determined to streamline it into a loop. Unfortunately, all my attempts thus far have been unsuccessful. The code displays four drop-down lists with different Id's, but they share the same class name (optionLinks)
.
Here is the current code snippet:
function init(){
var allE = document.getElementById("executive");
allE.onchange = loadLink;
var allL = document.getElementById("legislative");
allL.onchange = loadLink;
var allJ = document.getElementById("judicial");
allJ.onchange = loadLink;
var allS = document.getElementById("state");
allS.onchange = loadLink;
}
Appreciate any assistance provided :)