After reviewing arr[i][3], I confirmed it was accurate. However, I encountered an issue with one of the statements. The code snippet is displayed below:
for(var i = 0; i<oDiv.length;i++){
arr.push([getAttr(oDiv[i],"left"),getAttr(oDiv[i],"top"),
getAttr(oDiv[i],"opacity"),getAttr(oDiv[i],"z-index")]);
//console.log(arr); it shows a correct value;
}
oBtn[0].onclick = function(){
arr.unshift(arr[arr.length-1]);
arr.pop();
for (var i = 0; i<arr.length; i++) {
oDiv[i].style.left = arr[i][0];
oDiv[i].style.top = arr[i][1];
oDiv[i].style.opacity = arr[i][2]; //these three statements worked;
oDiv[i].style.z-index = arr[i][3]; //it doesn't work.
}
}