src/selectivity.js
function(input, options) {
        this.input = input;

        var selectivity = this;
        var inputListeners = this.options.inputListeners || Selectivity.InputListeners;
        inputListeners.forEach(function(listener) {
            listener(selectivity, input, options);
        });

        if (!options || options.search !== false) {
            input.addEventListener('keyup', function(event) {
                if (!event.defaultPrevented) {
                    selectivity.search(event.target.value);
                }
            });
        }
    }
function(input, options) {
        this.input = input;

        var selectivity = this;
        var inputListeners = this.options.inputListeners || Selectivity.InputListeners;
        inputListeners.forEach(function(listener) {
            listener(selectivity, input, options);
        });

        if (!options || options.search !== false) {
            input.addEventListener('keyup', function(event) {
                if (!event.defaultPrevented) {
                    selectivity.search(event.target.value);
                }
            });
        }
    }
function ( input , options ) { this . input = input ; var selectivity = this ; var inputListeners = this . options . inputListeners || Selectivity . InputListeners ; inputListeners . forEach ( function ( listener ) { listener ( selectivity , input , options ) ; } ) ; if ( ! options || options . search !== false ) { input . addEventListener ( 'keyup' , function ( event ) { if ( ! event . defaultPrevented ) { selectivity . search ( event . target . value ) ; } } ) ; } }
Initializes the input element.

Sets the input property, invokes all input listeners and (by default) attaches the action of
searching when something is typed.

@param input Input element.
@param options Optional options object. May contain the following property:
search - If false, no event handlers are setup to initiate searching when the
user types in the input field. This is useful if you want to use the
input only to handle keyboard support.
Initializes the input element .