xxxxxxxxxx
1
<form class="multi-range-field my-5 pb-5">
2
<input id="multi22" class="multi-range" type="range" />
3
</form>
4
5
<!-- Example -->
6
<label for="ex3">Example</label>
7
<input type="text" id="ex3" class="form-control" disabled>
8
<label for="ex4">Example</label>
9
<input type="text" id="ex4" class="form-control" disabled>
10
1
1
xxxxxxxxxx
1
$('#multi22').mdbRange({
2
single: {
3
active: true,
4
multi: {
5
active: true,
6
rangeLength: 1,
7
}
8
}
9
});
10
11
const countingTargets = ['#ex3', '#ex4'];
12
13
$('.multi-range-field > input').each(function(index, el) {
14
$(el).on('change', function(e) {
15
e.preventDefault();
16
17
// function that will update your output element/database etc... e.g.
18
const $countingTarget = $(countingTargets[index]).val(e.target.value)
19
})
20
})
Console errors: 0