I need to be able to go through each item in the array and click it. The array represents ID's of elements that need to be clicked. Here is the code that retrieves the array and places it in the variable arrayResponse
//["2","3","4","5","1","2","3","4","5"]
function reqListener () {
console.log(this.responseText);
}
var oReq = new XMLHttpRequest(); //New request object
oReq.onload = function() {
//The actual data is found on this.responseText
var arrayResponse = this.responseText; //Assign array to variable
alert(arrayResponse);
arrayResponse.forEach(function(entry) {
//Click through array here
});
};
oReq.open("get", "load.php", true);
oReq.send();
HTML
<img id="1" class="image" src="ON-Green.png">