Home › Forums › JavaScript › jQuery text() works on DOM object, but, not addClass() › Reply To: jQuery text() works on DOM object, but, not addClass()
February 28, 2014 at 2:52 am
#164347
Participant
Are you trying to set the first tab to active? If so you could use: tabs.eq(0).addClass(‘active’);
eq returns jQuery object at given index.
get returns DOM element which doesn’t have method addClass.