simple-selectable
v1.0.1
Published
Simple single-select for html elements
Downloads
5
Readme
selectable
Simple single-select for html elements - Examples
Install
Usage
var Selectable =
require('simple-selectable')
var selectable = new Selectable({
items: document.querySelectorAll('.items'),
allowActiveDeselect: false //Optional, deselect active item if clicked. Defaults to false,
});
Listen to changes
selectable.on('selectable.change', function(newItem, oldItem){
//do sth
})
items containing a 'disabled' class can't be activated
Destroy
selectable.destroy()
License
MIT