How to shorten the script?
$('span.class_1').hover(function(){ $('div.class_1').fadeToggle(); }); $('span.class_2').hover(function(){ $('div.class_2').fadeToggle(); }); $('span.class_3').hover(function(){ $('div.class_3').fadeToggle(); }); // И так далее... до 60 штук UPD : In general, I have a <li> with nested span and div . When I hover over a span this li I need to display a div .
spananddivusing data-attributes or by searching for the corresponding element within the parent - tutankhamun