I want to put a div inside another div, and when the user put the mouse on the parent div the two divs show up.
The problem is that when I put the mouse over the parent div the two divs show up but when I move the mouse over the child div the show() function execute it self again, how can I stop that?
HTML code:
<div id="parent" onmouseover="show(this)">
<div id="child"></div>
</div>
JavaScript code:
function show(element) {
setTimeout(function () {
opacity(element)
}, 100);
}
function opacity(element) {
element.style.opacity = "1"
}