In my top navigation there are several links which are basically subsites. Under subsites are further sites or pages. I am using SharePoint 2013 default top navigation in my custom master page. I got its code from "Design Manager".

There is a particular top level subsite which I want to make unclickable. For e.g. currently this is the top navigation.


I want to make Subsite1 unclickable so is there a way to put a # in its URL so when user clicks it, nothing happen.

  • That would confuse users, I'm sure. Why would you like to make a LINK not clickable? Isn't it better to hide it altogether? I'm just curious. – Benny Skogberg Nov 18 '13 at 12:53
  • Because that link has no content but other links are coming under it have. This is client requirement. – Frank Martin Nov 18 '13 at 12:57

You could achieve that using jQuery. Get the first link of the dropdown menu and set the href of that link.

$(function() {
    $("#DeltaTopNavigation > div > ul > li > ul > li > ul > li > a:first").attr("href", "#");

If you want the link to be completely unclickable, then you could also remove its attribute.

$(function() {
    $("#DeltaTopNavigation > div > ul > li > ul > li > ul > li > a:first").removeAttr("href");

Instead of adding a link add a label

enter image description here

  • Your Answer fits for SharePoint Online/Modern Experience. The Question was for SharePoint 2013 which has no Modern Experience. – PhilFancy Jul 15 '20 at 11:15
  • Sorry, I ended up here by searching for this also, so I thought others could end up here also – Keytrap Jul 15 '20 at 13:04
  • Welcome Ask a similar question relevant and then answer it yourself, that way it can benefit others without adding confusion original question – James Randal Jul 15 '20 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.