title: Change active object opacity from slider fabricjs
body: <p>I'm trying to change the opacity of active canvas object from slider, and I can't figure why this code doesn't work. I'm using fabric.js.</p>
  
  <p>the html of the slider:</p>
  
  <pre><code>&lt;input class="opacity-slider" type="range" max="100" min="0" step="1" value="100"&gt;
  </code></pre>
  
  <p>js:</p>
  
  <pre><code>var obj = canvas.getActiveObject();
  $(document).on("change", ".opacity-slider", function (){
      var opacity = $(".opacity-slider").val();
      $(".slider-value").text(opacity);
      canvas.getActiveObject().setOpacity(opacity)
      canvas.renderAll();
  });
  </code></pre>