Many people answered with jQuery
parent, but just to add on to that I wanted to share a quick snippet of code that I use for adding classes to my navs so I can add styling to li
's that only have sub-menus and not li
's that don't.
$("li ul").parent().addClass('has-sub');