How do I get the <li> value of a jQuery hover function?
My html content looks like this:
<ul>
<li class=folder>Main
<ul>
<li class=folder>1st fldr
<ul>
<li> child1
<li> child2
</ul
</ul>
</ul>
Now I want to get the value folders
(main, 1st fldr) as my cursor overlay method is as follows,
$('ul li.folder').hover(function () {
alert($(this).text());
});
but I am not getting the meaning, can anyone help me on this.
+3
source to share
4 answers