I'm trying to find a li
with a certain class ( selected
), however, I have not been able to find id
of it.
Here is the code
var slide_act = $(".bull").find("selected").attr("id");
console.log(slide_act);
The undefined
appears on the console whenever I run the click
function. Any explanation?
Complementary Code
<ul class="bullets">
<li class="bull selected" id="slide1"></li>
<li class="bull" id="slide2"></li>
<li class="bull" id="slide3"></li>
</ul>