Better select widgets in vanilla javascript.
The code is intentionally very simple and close to browser defaults.
<link rel="stylesheet" href="select.css">
<script src="select.js" type="module"></script>
<script>
new Select(element, {
id: 'myselect',
inputClass: 'my-input-class',
valueClass: 'my-value-class',
});
</script>
This library does work on mobile. However, select usability on mobile is usually far superior to that on desktop. Therefore it is recommended to only use this on desktop.
- allowClear