npm install my-selectrequire('my-select') and npm i- select : selector of the select you want to fake
- container : selector of the container who the fakeselect will be append
``js
var Select = require('my-select');
document.addEventListener('DOMContentLoaded', function () {
new Select({
select: '#custom',
container: '.someWhereToAppend'
});
}, false);
`
Obviously, each time you click on a list item, the select binded will have his
selected value changed.
You can add a change event who will be triggered each time the value change.
You need to pass a callback with the selected value as arguments.
Ex:
`js
var custom = new Select({
select: '#custom',
container: '.someWhereToAppend'
});
custom.on('change', function(selectedValue) {
console.log(selectedValue);
});
`
js
var selects = new Select({
nativeOnDevice: false
});
``