0
var x = ["s1","s2","s3","s4","s5","s6","s7","s8","s9","s10","s11",......,"s100"];

for (var i = 0; i < x.length; i++) {
document.getElementById(x[i]); }

var c = document.getElementById(x);
var a = document.getElementById("s2");
var b = document.getElementById("hover");

c.addEventListener('mouseover', function() {
      b.style.display = "block";
});
c.addEventListener("mouseout", function() {
      b.style.display = "none"; 
});

I have gallery of 100pictures, that needs mouseover action, so I wanted to use array like Id selector,and as you see I am not quite sure how to do this :D, so if anyone could help me a would be very thankful.

0 Answers0