how do i add a listener for hovering over div tags like this:
| btn1 | btn2 | btn3 | btn4 |
i want to add a listener that loops through them like i show below and then applies a function if it has mouseover.
function listen() {
for (i=1;i<=10;i++) {
wat = document.getElementById('btn'+i);
wat.addEventListener('mouseover',functionwat,false );
}
}
i have this and its not working, and yes it is calling the function listen(), because i added an alert thing in there to make sure its working correctly, and functionwat works right too. any ideas im doing wrong?