Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery text() works on DOM object, but, not addClass() Reply To: jQuery text() works on DOM object, but, not addClass()

#164347
ryanknights
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.