title: Changing slider color
body: <p>I want to be able to create multiple sliders of different colors. One of the suggestions I found online was to create multiple classes in my CSS file for each color and to call on the needed class when defining the slider. </p>
  
  <p>It is not clear how to override CSS in Javascript and how to change my html file accordingly. Please find code attached below:</p>
  
  <pre><code>&lt;body&gt;
   &lt;div id="testslider"&gt;&lt;/div&gt;
   &lt;script&gt;
    var slider = d3.slider().min(0).max(1).value(1).ticks(1).showRange(true);
    d3.select('#testslider').call(slider);
    d3.selectAll(".tick&gt;text").style("text-anchor", "start");
    d3.selectAll(".tick:last-of-type&gt;text").style("text-anchor", "end");
  
   &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>The output should look like the following:
  <a href="https://i.stack.imgur.com/RqDBE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RqDBE.png" alt="enter image description here"></a></p>