Posted in: Javascript, jQuery

Remove link from parent pages in a menu, but not children

Give the parent list items a new class. For example: parentClassName. Then use this script to void the href.

jQuery(function($) {
$("li.parentClassName").children("a").attr('href', "javascript:void(0)");
});

Don’t forget to add surrounding script tags.

Have your say