<li id="level2List" onclick="markLevel1();">List</li>
function markLevel1() {
$("#level2List").parent.parent.addClass("yourClass")
}
This solution assumes the following menu structure and the use of jQuery
<ul>
<li>level 1
<ul>
<li>level 2</li>
</ul>
</li>
</ul>
This could be improved or generalized by using class instead of id, use of $(this) within the function and/or naming the parent so you could use .closest("selector") function from jQuery.
Adjust to your particular menu stucture