I am currently in the process of learning web development languages, and I'm attempting to create a dropdown list using JavaScript (I previously tried in CSS without success).
I would greatly appreciate it if you could review my code and let me know what might be causing any issues.
<nav>
<ul class="anchors">
<!-- The dropdown list should appear when hovering over this area -->
<li class="list-comanda">
<a href="javascript:void(0)" onmouseover="dropdown()">Comanda</a>
</li>
<div class="dropdown" id="dropdown" style="display: none;">
<ul class="dropdown-list">
<li class="dropdown-l-magneti"><a href="magneti"> Magneti de frigider personalizati</a></li>
<li class="dropdown-l-hartie"><a href="hartie"> Obiecte facute din hartie</a></li>
</ul>
</div>
<li class="list-contact"><a href="contact">Contacteaza-ma</a></li>
</ul>
</nav>
<script>
function dropdown{
var dropdown = document.getElementById("dropdown");
dropdown.style.display = "inline-block";
}
</script>
I apologize for any lack of organization in my code.