After exploring different methods and seeking guidance on this platform, I am still unable to achieve the desired outcome. My goal is to have the content in the "topb" section appear when hovering over a link with the class of "top" and disappear when the mouse moves away. Unfortunately, I am struggling to even make the div show up upon mouseover. Any advice or suggestions would be greatly appreciated. Thank you.
var num1 = document.getElementByClassName("top");
num1.onmouseover(function() {
var changeIt = getElementByClassName("topb");
if (changeIt.style.visibility === "hidden") {
changeIt.style.visibility = "visible";
}else {
changeIt.style.visibility = "hidden";
});
.topb {
position:absolute;
top:140px;
left:420px;
color:black;
border:2px solid black;
padding-left:10px;
padding-right:10px;
visibility:hidden;
}
<ul class = "sidebar">
<li> <a class="top" href= "filename.html"> A </a>`enter code </li>
<li> <a class="second" href= "filename.html"> B </a> </li>
<li> <a class="third" href= "filename.html"> C </a></li>
<li> <a class="fourth" href= "filename.html"> D </a></li>
<li> <a class="bottom" href= "filename.html"> E </a></li>
</ul>
<div class="topb">
<p> sample of application here </p>
</div>