I am trying to loop a function a number of times but it doesn't work for some reason. anybody see the problem?
this works
<script>
$(document).ready(function() {
$('.menuitem0').hover(function(){
$('.boxitem0').addClass('box_hover');
},
function(){
$('.box_item0').removeClass('box_hover');
});
}});
</script>
but when i try and loop it it doesnt work
<script>
$(document).ready(function() {
for(var i = 0; i < 10; i++) {
$('.menuitem'+i).hover(function(){
$('.box_item'+i).addClass('box_hover');
},
function(){
$('.box_item'+i).removeClass('box_hover');
});
}});
</script>