How to properly add mouseover functionality in javascript. You can add onmouseover keyword argument in the element.
<div onmouseover="processMouseOver(this)">
Your Children Element Here.
</div>
Make sure to call this then only function accepts element as argument otherwise will be null.
This is how the javascript code look like.
function processMouseOver(element) {
console.log(element)
}
addEventListenerworks only if the element is already available in the DOM. If you add new element append to the DOM then chances are the addEventListener will not work.