Solution 1 :

Please consider the following example. This uses .val() instead of .attr() and will have better results.

$(function() {
  var timer;
  var start;

  function updateDuration(n) {

  $(".psudeo-player button").click(function() {
    start = new Date().getSeconds();
    timer = setInterval(function() {
      var t = Math.floor(new Date().getSeconds() - start);
      if (t >= parseInt($(".duration")[0].max)) {
    }, 1000);
.psudeo-player {
  background-color: #555;
  border: 1px solid #222;
  width: 480px;
  height: 340px;
  position: relative;

.psudeo-player button {
  position: absolute;
  top: calc(50% - 9px);
  left: calc(50% - 30px);

.current {
  width: 2em;

.duration {
  width: 430px;
<script src=""></script>
<div class="psudeo-player">
<input type="text" class="current" value="0" disabled><input class="duration" min="0" max="20" type="range" value="0">

Problem :

I am making a song-player with Howler.js and Javascript/JQuery.

I have an input[type=range] which displays the progress of the song:

<input class="duration" type="range" value="0">

There is a function that executes when the song is played:

onplay: function() {
        $('#everytime_we_touch .duration').attr('value',;

This does work and the progress on the input[type=range] visibly changes. However, when I click on the input[type=range] manually, the value-attribute inside of the input[type=range] still changes, but visibly it is stuck. I use this method for manually changing the song-progress:

$('input[type=range].duration').on('input', function () {
    let howl_name = $(this).parent().parent().parent().attr('id');
    let duration_value = this.value;
    eval(howl_name + '.seek(' + duration_value + ')');

Thanks in advance


Comment posted by Twisty

You may want to use

Comment posted by Twisty


Comment posted by aughhhh


Comment posted by aughhhh

WOW! Using .val() instead of .attr() was the answer!

Comment posted by Mark M

I have the same problem but I am not using JQuery. I use mySlider.setAttribute(‘value’, newVal) which changes the value but the thumb doesn’t move. This only happens after the thumb or track has been clicked. Any idea why or how to fix?

Comment posted by Mark M

Any idea why val() works better than attr()? I have the same problem as the OP but I am not using JQuery and I’m looking for a solution with plain js.

Comment posted by Twisty

@MarkM There are seeking different things.

Comment posted by Mark M

Great, thanks! You are right, when I changed