How can this be achieved using vanilla javascript? Following uses jQuery syntax.
$(function(){
$("ul.dropdown li").hover(
function(){
$(this).addClass("hover");
$('ul:first',this).css('visibility', 'visible');
},
function(){
$(this).removeClass("hover");
$('ul:first',this).css('visibility', 'hidden');
}
);
$("ul.dropdown li ul li:has(ul)").find("a:first").append(" » ");
});
Something like this is similar:
(But not the same)