这就是我想要做的:
var numArray = ["One","Two","Three","For","Five","Six"];
for (i = 0, i < numArray.length; i++) {
document.getElementById('results').innerHTML += <div id='listResult_"+[i]+"'></div><br>;
var target = document.getElementById('listResult_'+[i]);
document.addDomListener(target, 'mouseover', function() {
alert("listResult_"+[i]);
});
}
它仅向最后一个目标 ID (listResult_5) 发出警报。如何单独针对所有六个?