simple-selectable

1.0.1 • Public • Published

selectable

Simple single-select for html elements - Examples

stable

Install

NPM

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

/simple-selectable/

    Package Sidebar

    Install

    npm i simple-selectable

    Weekly Downloads

    7

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • stbaer