Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
170
rated 0 times [  175] [ 5]  / answers: 1 / hits: 24984  / 10 Years ago, mon, july 7, 2014, 12:00:00

I have a list of tabs with elements that can be disabled - i.e. non-clickable. And when 'disabled' is added as a class, then the mouse over on the element is indicating that the tab is non-clickable. Unfortunately the element is clickable.
I am trying to remove the datatoggle=tab from the element when the element is disabled, but my jQuery skills aren't sufficient.



I have a ul of class=nav nav-tabs with id=myTabs
And I'm trying to remove the data-toggle attribute with this jQuery statement:



$('#myTabs a').is('.disabled').removeAttr('data-toggle');


Bootply example


More From » jquery

 Answers
9

You can try this:-



$('#tabs li.disabled').find('a').removeAttr('data-toggle');


or



$('#tabs li.disabled a').removeAttr('data-toggle');


Demo


[#70293] Friday, July 4, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
harleyaleenag

Total Points: 678
Total Questions: 121
Total Answers: 105

Location: Papua New Guinea
Member since Thu, Jul 9, 2020
4 Years ago
harleyaleenag questions
Thu, May 5, 22, 00:00, 2 Years ago
Wed, Aug 19, 20, 00:00, 4 Years ago
;