I want to create a rule to target the a element in the following:
a
Root Me
$('#root a').click(function(e) { if ( $(this).parents('ul').length > 1 ) { e.preventDefault(); // cancel action for anchors inside of #root who have multiple parent list elements } });
Change logic per requirement.