Navigation Bar provides us with  the infrastructure to add different navigation link options in a site. We can provide the navigation links within “Top Navigation” and “Quick Launch Navigation”.
hostforlifebanner
Here, I am providing the code through which we can manipulate the navigation links both in Top navigation & Quick Launch navigation. I have added two navigation nodes; i.e., TeamSiteNavigation,TopNavigation.
I have used 3 buttons and their corresponding functions. Here, I am sharing the functionalities and their respective functions below.
First, I have got the current context and web. Then I got the navigation collection of top navigation Bar. You can also get the Quick Launch by using “get_quickLaunch();”
Then I set properties for a new navigation node & created node as the last node in the collection.
Here I am retrieving the navigation collection of top navigation.
Here I am removing the navigation from the navigation collection, which I have provided in the text box.
Follow the below instructions and refer to the corresponding image to perform the Operation,
Click on Add Navigation,
After adding the node,
Click on Show Navigations Names,
Now we can check Navigation name in the alertbox,
Give the navigation node which you want to delete.
I’ve successfully deleted the navigation node.