I have a div that is initially set to display:hidden
. I am looking to change the display property to display:block
when a specific element (#navbar li a
) is hovered over. Below is the JavaScript code I have written for this functionality.
$('document').ready(function(){
$("#navbar li a").onmouseover(function{
$("#navbar ul").css("display","block");
});
});
I have verified that $("#navbar li a")
is correctly targeting the desired element. Can you please review my JavaScript code and let me know if you identify any errors?
edit: Please note that this refers to a dropdown menu, where #navbar ul
represents a nested list.