I’m trying to do this:
$('li').eq(newCurrent).addClass('current');
I’ve tried index() as well but I’m certainly missing something. I’m passing the ‘newCurrent’ variable, which is a list item a user has clicked on, as an argument to a function of which this is the last statement.
alerting just before verifies that “newCurrent” is the appropriate number/indice of the unordered list that I want to address.
I played with multiple selectors using .add but nope… I’m stuck?
Here you can do this