For my use, the best solution was a mix of some of the answers here, which are :
disabled
class to the li I want to disable$(".nav .disabled>a").on("click", function(e) {
e.preventDefault();
return false;
});
NOTE: The JS code here is important, even if you remove the data-toggle because otherwise, it will update your URL by adding the #your-id
value to it, which is not recommended because your tab is disabled, thus should not be accessed.