How can I update the state of radio buttons to match carousel status?
<p>I use radio buttons like a pagination for my carousel, which works fine. If I change the slide using the carousel buttons instead of the radio buttons, the state of the radio buttons doesn't change, so the selected button doesn't match the selected slide. How can I fix this?</p>

<p><a href="http://codepen.io/anon/pen/eZrQjV" rel="nofollow">Here is my template</a></p>

<p>HTML:
</p>

<pre class="lang-html prettyprint-override"><code>&lt;div class="container"&gt;
    &lt;div id="carousel" class="carousel slide" data-interval="false" data-ride="carousel"&gt;
      &lt;div class="carousel-inner" role="listbox"&gt;
        &lt;div class="item active"&gt;
          &lt;img class="img-responsive center-block" src="http://www.w3schools.com/bootstrap/img_chania.jpg"&gt;
        &lt;/div&gt;
        &lt;div class="item"&gt;
          &lt;img class="img-responsive center-block" src="http://www.w3schools.com/bootstrap/img_chania2.jpg"&gt;
        &lt;/div&gt;
        &lt;div class="item"&gt;
          &lt;img class="img-responsive center-block" src="http://www.w3schools.com/bootstrap/img_flower.jpg"&gt;
        &lt;/div&gt;
        &lt;div class="item"&gt;
          &lt;img class="img-responsive center-block" src="http://www.w3schools.com/bootstrap/img_flower2.jpg"&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="left carousel-control" href="#carousel" role="button" data-slide="prev"&gt;
        &lt;span class="glyphicon glyphicon-chevron-left" aria-hidden="true"&gt;&lt;/span&gt;
        &lt;span class="sr-only"&gt;Previous&lt;/span&gt;
      &lt;/a&gt;
      &lt;a class="right carousel-control" href="#carousel" role="button" data-slide="next"&gt;
        &lt;span class="glyphicon glyphicon-chevron-right" aria-hidden="true"&gt;&lt;/span&gt;
        &lt;span class="sr-only"&gt;Next&lt;/span&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;br&gt;
  &lt;center&gt;
    &lt;div class="btn-group" data-toggle="buttons"&gt;
      &lt;label class="btn btn-primary active s1"&gt;&lt;input type="radio" name="options" autocomplete="off" checked&gt;1&lt;/label&gt;
      &lt;label class="btn btn-primary s2"&gt;&lt;input type="radio" name="options" autocomplete="off"&gt;2&lt;/label&gt;
      &lt;label class="btn btn-primary s3"&gt;&lt;input type="radio" name="options" autocomplete="off"&gt;3&lt;/label&gt;
      &lt;label class="btn btn-primary s4"&gt;&lt;input type="radio" name="options" autocomplete="off"&gt;4&lt;/label&gt;
    &lt;/div&gt;
  &lt;/center&gt;
</code></pre>

<p>JS:</p>

<pre class="lang-js prettyprint-override"><code>$(function () {
    $(".s1").click(function () {$("#carousel").carousel(0);});
    $(".s2").click(function () {$("#carousel").carousel(1);});
    $(".s3").click(function () {$("#carousel").carousel(2);});
    $(".s4").click(function () {$("#carousel").carousel(3);});
});
</code></pre>