javascript - How to make a Bootstrap navbar item unclickable? -


in navbar example on bootstrap site, programmatically make 1 of navbar items (let's link) disabled/unclickable.

i've tried .addclass('disabled'), .removeclass('active'), nothing seems work.

am missing simple?

if want make click on menu item not anything, can use following jquery syntax disable effect:

$(/* jquery selector menu item */).click(function(e) {      e.preventdefault(); }); 

then can style button "disabled" or gray color if desire, user knows unclickable. solution compatible browsers support jquery.

here jsfiddle demo of solution (thanks @adjit in comments!): http://jsfiddle.net/7a2p8jjn/1/


Comments