HTML
xxxxxxxxxx
1
<div id="selectValues">
2
<select class="select" data-mdb-clear-button="true" data-mdb-container="#selectValues">
3
<option value="1">One</option>
4
<option value="2">Two</option>
5
<option value="3">Three</option>
6
<option value="4">Four</option>
7
<option value="5">Five</option>
8
</select>
9
</div>
CSS
1
1
JS
xxxxxxxxxx
1
const clearBtn = document.querySelector("#selectValues .select-clear-btn")
2
clearBtn.addEventListener('click', ()=>{
3
console.log('cleared')
4
})
5
Console errors: 0