Hi there. I've switched from Mootools to jQuery, because I think it has better support. I've got HTML like that:
<ul class="menuHandler">
<li class="menuTreeElement activeOpt" id="menuOpt1">
<ul id="menuOpt1Content">
<li><a href="#" class="menuOpener">Opcje</a><a href="#" class="sprite menuOpener"></a></li>
<li class="submenuElement">Opcje</li>
<li class="submenuElement">Opcje</li>
<li class="submenuElement">Opcje</li>
<li class="submenuElement">Opcje</li>
<li class="submenuElement">Opcje</li>
<li class="submenuElement">Opcje</li>
</ul>
</li>
</ul>
JS
jQuery(document).ready(function($)
{
$('.menuTreeElement .submenuElement').hide();
$('.menuHandler li.menuElement, .menuHandler li.menuTreeElement').removeClass('activeOpt');
$('.menuHandler li.menuElement, .menuHandler li.menuTreeElement').addClass('inactiveOpt');
$('.menuHandler li.menuElement a.menuOpener, .menuHandler li.menuTreeElement a.menuOpener').click(function(e){
e.preventDefault();
alert(this);
alert(this.id);
alert($(this));
alert(e.target);
alert(e.target.id);
alert($(e.target));
});
});
Results:
URL, Empty alert, [object Object], URL, Empty alert, [object Object]. I don't know what to do. Link if it'll help: http://misiur.com/CRP/admin/
I want to achieve that: 1. You click on a with class menuOpener 2. all li with class submenuElement inside same ul (in this case menuOpt1Content) are showing