All I want is set getElementById by var (it must be automatic because I have got multiple of this range inputs (brightness, contrast, sharpen, etc.). How can I do this?
function showVal(value, id) {
var spanId = "#" + id + "Id";
document.getElementById("\"" + spanId + "\"").innerHTML = value;
}
<div class="row" style="display: inline-block; width: 45%; margin: 0px 5px 5px 5px;">
<div class="col-sm-5" style="padding: 2px;">
<label class="control-label" style="float: left">Jasność:</label>
<span class="filterValue" id="brightnessId">0</span>
</div>
<div class="col-sm-7" style="padding: 2px;">
<input id="brightness" type="range" min="-100" max="100" step="1" value="0" data-filter="brightness" onchange="showVal(this.value, this.id)">
</div>
</div>
#
and quotes as an ID?