xxxxxxxxxx
1
<span class="m-4"></span>
2
<span class="m-4"></span>
3
<div class="wrapper">
4
<div class="multi-ranges-start-values"></div>
5
6
</div>
7
8
<span class="m-4"></span>
9
<span class="m-4"></span>
10
<button class="reset btn btn-primary mt-4">
11
Reset
12
</button>
1
1
xxxxxxxxxx
1
const startValue = document.querySelector('.multi-ranges-start-values');
2
const wrapper = document.querySelector('.wrapper');
3
const resetButton = document.querySelector('.reset')
4
const startValueInit = new mdb.MultiRangeSlider(startValue, {
5
startValues: [4, 100]
6
});
7
8
9
resetButton.addEventListener('click', (e) => {
10
wrapper.innerHTML = "";
11
const newEl = document.createElement('div');
12
wrapper.appendChild(newEl)
13
const newSlider = new mdb.MultiRangeSlider(newEl, {
14
startValues: [4, 100]
15
});
16
});
Console errors: 0