How to rewrite this on jQuery <p>I have ul with 5 li inside, need to select one of them with index [curSlide-1], I writed it on JS, but can't do that on jQuery:</p> <pre><code>var $bullets = $("ul").find(".bullet"); var curSlide = 5; document.getElementsByClassName("bullet")[curSlide-1].className = "bullet active-bullet"; </code></pre> <p>I've tried to write it on jQuery, but it doesn't work:</p> <pre><code>$bullets[curSlide-1].addClass("active-bullet"); </code></pre> <p>Can somebody tell how to rewrite it correctly?</p>