What are you trying to achieve? Your code does not make any sense at all. You have to seriously learn the stuff, trying by luck is not going to bring you anywhere. Learn some real stuff at
jQuery Tutorial[
^] .
Coming back to your make-no-sense code and not-at-all-clear question, if you are trying to show/hide a menu list, you can do a toggle, a sample code below:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
$("#nav ul").css("display", "none");
$("#nav").hover(function(){
$("ul").toggle(500);
});
});
</script>
</head>
<body>
<div id="nav">MENU
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
<li>jQuery</li>
</ul>
</div>
</body>
</html>
or try out this demo at
JSFiddle[
^]. Read up on some jQuery tutorial so that you can understand the code. Luck is elusive, only learning is real.