title: JQuery - change background image when sliding according to data-ride carousel when active
body: <p>is there a way to override the bootstrap carousel indicator? I want to change the background of the indicator when an item is active.</p>
  
  <p>Normally in bootstrap's default carousel, the indicator is only like this: </p>
  
  <p><a href="https://i.stack.imgur.com/uh8cn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uh8cn.png" alt="enter image description here"></a></p>
  
  <p>Its got to do with <strong>class="active"</strong> but i dont know how to properly execute it in js. thanks in advance.</p>
  
  <pre><code>&lt;div id="myCarousel" class="carousel slide" data-ride="carousel"&gt;
      &lt;!-- Indicators --&gt;
  
      &lt;ol class="carousel-indicators" id="div-indicators"&gt;
          &lt;li class="ind-img1 active" id="round-image1" data-target="#myCarousel" data-slide-to="0"&gt;&lt;/li&gt;
          &lt;li class="ind-img2" id="round-image2" data-target="#myCarousel" data-slide-to="1"&gt;&lt;/li&gt;
          &lt;li class="ind-img3" id="round-image3" data-target="#myCarousel" data-slide-to="2"&gt;&lt;/li&gt;
          &lt;li class="ind-img4" id="round-image4" data-target="#myCarousel" data-slide-to="3"&gt;&lt;/li&gt;
      &lt;/ol&gt;
  
      &lt;div class="carousel-inner"&gt;
          &lt;div class="item active" id="1"&gt;
              &lt;!-- Indicators --&gt;
  
              &lt;div class="container item_quote"&gt;
                  &lt;img src="{% static 'img/landingpage/quote-1.png' %}"&gt;
              &lt;/div&gt;
  
              &lt;div class="container item_message"&gt;
                  &lt;span&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elite.&lt;/span&gt;&lt;br/&gt;
                  &lt;span&gt;Lorem ipsum dolor sit amet, consectetur &lt;/span&gt;&lt;br/&gt;
                  &lt;span&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elite.&lt;/span&gt;&lt;br/&gt;
                  &lt;a class="proof-modal" data-toggle="modal" data-target="#lightbox"&gt;
                      Click here to enlarge image
                  &lt;/a&gt;&lt;br/&gt;
  
                  &lt;span&gt;- first testimonial&lt;/span&gt;
              &lt;/div&gt;
  
              &lt;div class="container item_quote"&gt;
                  &lt;img src="{% static 'img/landingpage/quote-2.png' %}"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;!-- more items --&gt;
      &lt;/div&gt;
  &lt;/div&gt; 
  </code></pre>
  
  <blockquote>
    <p><strong>EDIT</strong></p>
  </blockquote>
  
  <p>for clarification i want to do it like this:</p>
  
  <pre><code>item[0] = img1.png
  item[1] = img2.png
  item[2] = img3.png
  </code></pre>
  
  <p>for every item i can change the background image depending what item is active.</p>