Q:

jQuery only top level list item only

I'm trying to prevent the default click on a menu item but still have the sub menu items clickable.
My menu structure:
<li class="menu-item"><a href="">Publications</a>
<ul class="sub-menu">
<li class="menu-item"><a href="">Books</a></li>
<li class="noclick menu-item "><a href="">Articles</a>
<ul class="sub-menu">
    <li class="menu-item"><a href="">Historical-Phenomenological</a></li>
    <li class="menu-item"><a href="">Contemporary Theology</a></li>
    <li class="menu-item"><a href="">Communal Affairs</a></li>
    <li class="menu-item"><a href="">Translations</a></li>
</ul>
</li>
</ul>
</li>

and the jQuery I'm using that disables the click on Articles and all links under it. I just want to disable click on the link for Articles.
jQuery(function($) {
    $('.noclick a').click(function(e) {
        e.preventDefault();
    });
});

A:

You are targeting all anchor elements within noclick, instead you can target only the children of noclick using the child selector
jQuery(function($) {
    $('.noclick > a').click(function(e) {
        e.preventDefault();
    });
});

