jquery.treeview problem : addClass("open");
Hi!
When I put the class "open" directly on the tag <li> it works fine. The sub-menu open as supposed.
<li id="sousmenu1" class="open"><span>Title of the submenu</span>
<ul>
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
<li>Link 4</li>
</ul>
</li>
But when I try to do it using javascript it doesn't work!
$("#sousmenu1").addClass("open");
I know that it calls the right tag since I tried this code :
$("#sousmenu1").
hide
();
And the sub-menu did hide.
But in the same time if I write this :
$("#sousmenu1").addClass("open");
alert($("#sousmenu1").hasClass());
The alert returns me "false"!
I don't know where I do something wrong... :S