I don't understand, why my code is not working. I need to set the class "selected" to the first a
My code
.selected {
color: green
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
$('.find a:first').addClass('selected');
</script>
<div class="events find">
<ul>
<li><a href="#0">Link 1</a></li>
<li><a href="#0">Link 1</a></li>
<li><a href="#0">Link 1</a></li>
</ul>
</div>