Is it possible to check whether an li has a specific class and then change an attribute.
<ol class="carousel-indicators">
<li class="active" data-slide-to="0" data-target="#carousel"></li>
<li data-slide-to="1" data-target="#carousel"></li>
<li data-slide-to="2" data-target="#carousel"></li>
</ol>
When an li is displayed it will add class=active as shown in the example below.
<li data-slide-to="2" data-target="#carousel" class="active"></li>
I want to target the class and then change the dynamically.
$("#carousel-link").attr("href", "http://www.w3schools.com/jquery");
For example if if li data-slide-to="1" is actve I want to change the link dynamically by using $("#carousel-link").attr("href", "http://www.w3schools.com/jquery");
For example if if li data-slide-to="2" is actve I want to change the link dynamically by using $("#carousel-link").attr("href", "http://www.w3schools.com/php");