Possible Duplicate:
How to get nth jQuery element
I have this simple code:
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
I know that my 2nd element should have a class active, how do I add this class?
this code won't work:
$('ul li').get(1).addClass('active')
I assume it is becuase it returns a dom element and not jquery element. but how do I do it right?
=======
Of course 2nd element is an example. I need each time to change the active class from a variable called theActiveClassNumber