javascript – How to create an overlay that appears on hover with the HTML structure below?

Right now, I’m creating an overlay div and a content div with the structure below, where the overlay div is above the content div and is absolutely positioned. I’m rendering the content of the overlay and content div with Django variables, and, in my actual code these are being created using a for loop, to render everything on the page.

When the user hovers over a specific content div, I want the corresponding overlay div to appear on top of it. So basically, if the user hovers over object 1, I only want the overlay for object 1 to show up, then once the mouse leaves the object, I want the overlay to disappear. Right now, this is being done through Javascript and onmouseover and onmouseout. However, as you can see with the fiddle below, the onmouseover is working but the onmouseout is not (I also tried onmouseleave but it also doesn’t work). So, what am I doing wrong here? Also, if this doesn’t work, can someone suggest any more methods where I can get the hover to work, without changing the HTML structure (I still want the overlay div first, and then the content div second, since when I changed the structure of the code, my styling completely messed up)?

I set up a fiddle here with one basic element, and it pretty much is how my code looks except I’m using a for loop to render multiple elements, and there is actual content, not just text. But, the onmouseout doesn’t work here as well.