Lets say that I want to turn the paragraph elements red when I mouseover the corresponding link elements.
Why would the following code not work and what is the simplest alternative?
for (i = 0; i < 100; i++) {
$("a").eq(i).mouseover(function(){
$("p").eq(i).css({"color":"red"})
})
}
Need simple explanation.