My question is: how do I prioritize the detection of a "mouseover" event for a child and not its parent?
this is jquery code:
<script>
$(function() {
$("li").mouseover(function(event){
$('#log').html($(this).text());
});
});
</script>
and this is the html code
<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3
<ul>
<li>item 3.1</li>
<li>item 3.2</li>
<li>item 3.3</li>
</ul>
</li>
<li>item 4</li>
</ul>
<div id="log">log</div>
How to display the current item when the mouse is executed?
the problem is that you hover over “item 3.1”, jquery won't detect “element 3.1” and instead jquery supposes you hover over “item 3”?
thank
ahmed source
share