<div class="stars">
<h3>d  </h3>
  <div class="stars__inner">
    <div class="stars__data"></div>
    <p class="stars__progress" id="p1"></p>
  </div>
  <div class="stars__count" id="param1">5.0</div>
</div>
.stars {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  width: 320px;
  margin: 20px;
}

h3{
  padding-right: 10px;
}

.stars__inner {
  position: relative;
}

.stars__count {
  font-size: 14px;
  line-height: 1.7;
  padding-left: 20px;
}

.stars__data {
  cursor: pointer;
  background: url(https://svgshare.com/i/H5_.svg);
  background-size: contain;
  background-position: center;
  display: block;
}

.stars__progress {
  background: red;
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
}

* {
  margin: 0;
  padding: 0;
}

.stars__data,
.stars__progress {
  width: 130px;
  height: 28px;
}
  //stars
  function move(e, obj) {
    var summ = 0;
    var id = obj.next().attr('id').substr(1);
    var progress = e.pageX - obj.offset().left;
    var rating = progress * 5 / $('.stars__data').width();
    $('#param' + id).text(rating.toFixed(2));
    obj.next().width(progress);
    $('.stars__count').each(function() {
      summ += parseFloat($(this).text());
    });
  };

  $('.stars__data').click(function(e) {
    $(this).toggleClass('fixed');
    move(e, $(this));
  });

  $('.stars__data').on('mousemove', function(e) {
    if ($(this).hasClass('fixed') == false) {
      move(e, $(this));
    }
  });

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js