Here is the line of code you can use to add a class or ID to an element in your webpage when a user hovers over it (for example: if you want to add a class called “active” to an li element with a class called “top-nav” in the div called “menu” when a user hovers over it):
$('#menu li').hover ( function(){ $('.top-nav').addClass('active')}, function() {$('.top-nav').removeClass('active')} ) </script>