3
I want that by passing the mouse by a li
, the result appears in div
placing the mouse on the Son 2: example: Father 1 > Son 2
or in the Father 2: Father 2
<li ><a href="#estaEm">Pai 1</a>
<ul>
<li ><a href="#estaEm" >Filho 1</a></li>
<li ><a href="#estaEm" >Filho 2</a></li>
</ul>
</li>
<li ><a href="#estaEm">Pai 2</a>
<ul>
<li><a href="#estaEm" >Filho 1</a></li>
</ul>
</li>
</div>
<div id="estaEm" value ="">resultado </div>
The jQuery I made doesn’t work in case only Father 2 appears:
$( "li" ).bind( "mouseover", function() {
var result=''
$( this ).find("a").each(function () {
result += " > " + $( this ).text()
});
$("#estaEm").text(result)
});
I didn’t quite understand your question, you would like something like this: https://jsfiddle.net/k214LLdj/ try to be clearer.
– Gabriel Rodrigues