Is it possible to determine the value/position of a user\'s click on a progress bar using plain javascript?
Currently, I can detect a click on the element but can only g
If you want the value clicked for a generic max value (a value between 0 and 1 in this case), you just need some simple math.
max
document.getElementById('progressBar').addEventListener('click', function (e) { var value_clicked = e.offsetX * this.max / this.offsetWidth; alert(value_clicked); });
Fiddle