I have a button that then when clicked runs this function and want to to change elements in my html which have ids and loop and do this in order and am unsure why I am unable to do this! (Must use an array do this, in mind alternate methods to do this could help) All responses appreciated! :) Thanks James
function Example() {
var color = [
"Pink",
"Black",
"Orange"
];
var ids = [
"Top",
"Mid",
"Bot"
];
for (i = -1, i != 3, i = i + 1) {
document.getElementById(ids[i]).style.background = color[i]
}